Started Rectangle Project
This commit is contained in:
commit
26e1253c0d
39 changed files with 544 additions and 0 deletions
15
homework06/DictionariesAndTry/dictionary3.py
Normal file
15
homework06/DictionariesAndTry/dictionary3.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/python
|
||||
# A directory example
|
||||
|
||||
dict = {'fName': 'Edward', 'lName': 'Bigos', 'Office': 617, 'Phone': '413-755-4544'}
|
||||
|
||||
|
||||
try:
|
||||
print("dict['fName'] dict['lName']: ", dict['fName']," ", dict['lName'])
|
||||
print ("dict['Office']: ", dict['Office'])
|
||||
print ("dict['Phone']: ", dict['Phone'])
|
||||
print ("dict['Mobile']: ", dict['Mobile'])
|
||||
except KeyError:
|
||||
print("\nInvalid key selected.")
|
||||
print("Sorry, there is no mobile phone number in the directory.")
|
||||
print("\n")
|
||||
Loading…
Add table
Add a link
Reference in a new issue