Guest User

#1LGPutBa (Python) [ptt.cc]

a guest
Apr 29th, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. #/usr/bin/env python3
  2.  
  3. d = {
  4.     "Tom": 50,
  5.     "Jerry": 70,
  6.     "Sally": 90,
  7. }
  8. check = []
  9.  
  10. while True:
  11.     name = input("Enter name: ")
  12.  
  13.     if name == "OK":
  14.         break
  15.     elif name in d and name not in check:
  16.         print('Grade: ' + str(d[name]))
  17.         check.append(name)
  18.     else:
  19.         print('Already in database')
Advertisement
Add Comment
Please, Sign In to add comment