Skip to content

Commit 8bcac5c

Browse files
author
iamshaunjp
committed
added lesson 14 code
1 parent b7c9850 commit 8bcac5c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎lessons/dictionaries.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def ninja_intro(dict):
2+
for key, val in dict.items():
3+
print(f'I am {key} and I am a {val} belt')
4+
5+
ninja_belts = { }
6+
7+
while True:
8+
ninja_name = input('add a ninja name: ')
9+
ninja_belt = input('add a ninja colour: ')
10+
ninja_belts[ninja_name] = ninja_belt
11+
12+
another = input('add another? (y/n): ')
13+
if another == 'y':
14+
continue
15+
else:
16+
break
17+
18+
ninja_intro(ninja_belts)

0 commit comments

Comments
 (0)