newbie in coding. I Cant understand how this string works and why its only printing the last string letter instead of all of them.
The objective is to print all letters untill the first number in a string. if the string isdigit() == true, return print ("").
For example if i input like this: func("abc") I cant understand why it only prints "c" instead of "abc"
Thanks !
def func(s):
for i in s:
if i.isdigit():
print("")
break
else:
print(i)