Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- try:
- result = float()
- first_num = float(input('Suda enter pervyi number '))
- action = input(str('Input action'))
- second_num = float(input('Suda enter vtoroi number '))
- if action == '+':
- result = first_num + second_num
- print(result)
- elif action == '-':
- result = first_num - second_num
- print(result)
- elif action == '*':
- result = first_num * second_num
- print(result)
- elif action == '/':
- result = first_num / second_num
- print(result)
- elif action not in ('/', '*', '+', '-'):
- print('Krivoe action')
- ex = str(input('Vyidem to talk? (Y/N)'))
- print(ex)
- if ex == 'N':
- pass
- elif ex == 'n':
- pass
- elif ex == 'Y':
- break
- elif ex == 'y':
- break
- except ZeroDivisionError as e:
- print('Are you mudak? na 0 nelzya delit!')
- except ValueError as q:
- print('Enter 4islo EPTA')
Add Comment
Please, Sign In to add comment