-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPT_loops01.py
More file actions
41 lines (33 loc) · 1.03 KB
/
PT_loops01.py
File metadata and controls
41 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
""" Aling Nena's Cashier Challenge
Author:
Description: During closing, Aling Nena counts from her vault the day's total income and
also the total amount of all her paper bills.
Help Aling Nena count her total income and total amount of her paper bills
from a list of cash money and using a loop!
"""
def is_coins(money):
""" Determine if the money is a coin
:param money: (Integer)
:return: (Boolean)
Examples:
>>> print(is_coins(20))
False
>>> print(is_coins(1))
True
"""
if money < 20:
return True
return False
cash_on_vault = [1, 5, 100, 10, 50, 50, 20, 5, 1, 1000, 1000, 500, 5, 200]
cash = 0
bills = 0
moneyCheck = False
###for loop for the logic
for row in cash_on_vault:
cash+=row
moneyCheck = is_coins(row)
# print('moneyCheck :',moneyCheck)
if(moneyCheck == False):
bills+=row
print("Hi Aling Nena! Your total income for the day is :",cash)
print("The total amount of your paper bills is :",bills)