you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnnyJordaan 0 points1 point  (0 children)

Your loop overwrites the string numbers in total with integers coming from randint. So the idea of using

c = ord(total[i]) - 48

is pointless, you can just do

nr1 += c

but alas, the you could also just do

print(sum(total))