fork(1) download
  1. x={}
  2. while True:
  3. while True:
  4. a = input ("Add name :" )
  5. if a != 'stop':
  6. b = input ("Add number :")
  7. x[a] = b
  8. else:
  9. break
  10.  
  11. while True:
  12. z = input ('Enter name for output on the screen number:')
  13. if z != 'stop':
  14. try:
  15. print(x[z])
  16. except:
  17. print('There is no such name. Try again')
  18. else:
  19. break
  20. '''
  21.  
  22. class Note():
  23. def __init__(self):
  24. self.book = {}
  25.  
  26. def add_name_and_number(self, name, number):
  27. self.book[name] = number
  28.  
  29. def output_number(self, name):
  30. print(self.book[name])
  31.  
  32. Note = Note()
  33. '''
  34.  
  35.  
Runtime error #stdin #stdout #stderr 0.02s 28384KB
stdin
Standard input is empty
stdout
Add name :
stderr
Traceback (most recent call last):
  File "./prog.py", line 4, in <module>
    a = input ("Add name :" )
EOFError: EOF when reading a line