Skip to content

Instantly share code, notes, and snippets.

@filinvadim
Last active February 28, 2017 22:22
Show Gist options
  • Save filinvadim/cca29dd889a059b2a957f410195c5abf to your computer and use it in GitHub Desktop.
Save filinvadim/cca29dd889a059b2a957f410195c5abf to your computer and use it in GitHub Desktop.
customers_balance_true = [25, 25, 25, 100]
customers_balance_false = [25, 25, 50, 100, 100]
def having_odd_money(money):
cinema_balance = 0
for banknote in money:
if banknote == 25:
cinema_balance += banknote
elif banknote == 50:
cinema_balance += banknote/2
cinema_balance -= banknote/2
elif banknote == 100:
cinema_balance += banknote*0.25
cinema_balance -= banknote*0.75
return cinema_balance >= 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment