def fun(str):
for i in range(len(str)):
print(i)
string = 'abc'
print(fun(string))
print results are
0
1
2
None
if I change
for i in range(len(str)-1):
the last result is still None
Why is this? And how do I stop it?
def fun(str):
for i in range(len(str)):
print(i)
string = 'abc'
print(fun(string))
print results are
0
1
2
None
if I change
for i in range(len(str)-1):
the last result is still None
Why is this? And how do I stop it?