Guest User

Untitled

a guest
Nov 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. while True:
  2. try:
  3. result = float()
  4. first_num = float(input('Suda enter pervyi number '))
  5. action = input(str('Input action'))
  6. second_num = float(input('Suda enter vtoroi number '))
  7.  
  8. if action == '+':
  9. result = first_num + second_num
  10. print(result)
  11. elif action == '-':
  12. result = first_num - second_num
  13. print(result)
  14. elif action == '*':
  15. result = first_num * second_num
  16. print(result)
  17. elif action == '/':
  18. result = first_num / second_num
  19. print(result)
  20. elif action not in ('/', '*', '+', '-'):
  21. print('Krivoe action')
  22. ex = str(input('Vyidem to talk? (Y/N)'))
  23. print(ex)
  24. if ex == 'N':
  25. pass
  26. elif ex == 'n':
  27. pass
  28. elif ex == 'Y':
  29. break
  30. elif ex == 'y':
  31. break
  32. except ZeroDivisionError as e:
  33. print('Are you mudak? na 0 nelzya delit!')
  34. except ValueError as q:
  35. print('Enter 4islo EPTA')
Add Comment
Please, Sign In to add comment