Problem : KOL15A
Why am I getting a runtime error on this code?
# cook your dish here
for tc in range(int(input())):
alpha = 'abcdefghijklmopqrstuvwxyz'
str1 = input().strip()
sum_str = 0
for i in str1:
if i not in alpha:
sum_str = sum_str+int(i)
if len(str1) == 0:
print(0)
else:
print(sum_str)
test cases do just fine. Has happened to me before and had to rewrite the code with a different logic. But this seems like a legit solution.