Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # Author Boumediene Kaddour ## you can put your name here :)
- # Date : 15/10/2014 22:24
- # helping people is a great thing
- database= {}
- choice = ''
- a ='''
- #################################
- \tHit CTRL+C to exit
- #################################
- '''
- print a
- dead = True
- while dead:
- try:
- choice =raw_input("Add or look up a word:(a|l)")
- if choice.lower() == 'a' or choice.lower() == 'add':
- key = raw_input('Type the word:')
- definition = raw_input('what is it: ')
- database[key.capitalize()] = definition.capitalize()
- print "Info has been added"
- elif choice.lower() == 'l' or choice.lower() == 'lookup':
- key = raw_input('Type the word: ')
- print database[key.capitalize()]
- else:
- print 'only a && add || l && lookup are allowed '
- except KeyboardInterrupt :
- dead = False
- exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement