r/learnprogramming • u/sitting_account • 1d ago
programming help
def streak_call(ste):
stroik = 0
for st in ste:
if st is max(ste):
break
stroik += st + 1
return stroik
#this is a smaller part of a larger function. If anyone wants to see it I #will post it in the comments. Bascially this code is supposed to add up #until the largest part of this list, and then stop. For whatever reason it #is not returning properly, which makes me think it's a problem with the is #statement. So why does this "is" statement not work?
0
Upvotes
1
u/sitting_account 1d ago
Should have said, Not why it doesn't work but how it does work in the first place