Skip to content
Code ReadingDid the Account Go Negative?
Break the Code

Did the Account Go Negative?

Write a list for which this function gives the wrong answer.
1def went_negative(amounts):
2 balance = 0
3 for a in amounts:
4 balance += a
5 return balance < 0