Skip to content

Commit 9ea0789

Browse files
authored
Merge pull request #6 from rjLelis/test_branch
Add type annotations
2 parents d287a93 + 3a4e355 commit 9ea0789

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

coin-register/REAME.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Code to manipulate coins value
55
### Worked concepts
66

77
* for loop
8-
* control flow
8+
* control flow
9+
* type annotations

coin-register/coin_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def num_coins(cents):
1+
def num_coins(cents: int) -> int:
22

3-
'''
3+
'''
44
num_coins(33) == 5
55
33 => 1 quarter, 1 nickel, 3 pennies => 5 coins
66
'''
@@ -21,14 +21,14 @@ def num_coins(cents):
2121
elif remaning_coins >= 10:
2222
number_of_coins += 1
2323
remaning_coins -= 10
24-
24+
2525
elif remaning_coins >= 5:
2626
number_of_coins += 1
2727
remaning_coins -= 5
28-
28+
2929
elif remaning_coins >= 1:
3030
number_of_coins += 1
3131
remaning_coins -= 1
32-
32+
3333

3434
return number_of_coins

0 commit comments

Comments
 (0)