Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00f9482 commit c6abed4Copy full SHA for c6abed4
test_key_in_dictionary
@@ -0,0 +1,27 @@
1
+#!/usr/bin/python
2
+
3
4
+bdayHash={'raf':"08/01/98", 'Jen':"08/03/76"}
5
6
+print "I know the birth days of:"
7
+for k in bdayHash.keys():
8
+ print k
9
10
+request = raw_input(">>> Who's birthday do you want to look up? ")
11
12
13
+while True:
14
15
+ if request not in bdayHash:
16
+ print "{} is not in the list. enter new value ".format(request)
17
+ request = raw_input(">>> Who's birthday do you want to look up? ")
18
19
+ else:
20
+ print "{} was born in {}".format(request,bdayHash[request])
21
+ break
22
23
24
25
26
27
0 commit comments