p
y
c
h
a
l
l
e
n
g
e
r
Home
Python Basics
Time to Practice I
Get nth character of string
Get nth character of string
Write a function that takes a string
a
and a number n as arguments. Return the nth character of
a
.
reset
def get_char(a, b):
# complete function here...
print(get_char('abcd', 1)) # expected output: 'a' print(get_char('zyxbwpl', 5)) # expected output: 'w' print(get_char('gfedcba', 3)) # expected output: 'e
Python
Setting up Python environment...
Output