Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from colorama import init
- from colorama import Fore, Back, Style
- init()
- print(Back.CYAN)
- print(Style.BRIGHT)
- print(Fore.MAGENTA)
- what = input ('Выберите действие. (+,-,*, / ,**,***,округление,pi): ')
- a = float(input('Введите первое число:'))
- if what in ['+','-','*', '/' ,'округление','pi']:
- b = float(input('Введите второе число:') )
- else:
- b = 0
- if what =='+':
- c = a + b
- print(Back.GREEN )
- print('Результат : ' + str(c))
- elif what =='-':
- c = a - b
- print(Back.RED )
- print('Результат : ' + str(c))
- elif what =='*':
- c = a * b
- print(Back.BLUE)
- print('Результат : ' + str(c))
- elif what =='**':
- c = a * a
- print(Back.WHITE)
- print('Результат : ' + str(c))
- elif what =='/':
- c = a / b
- print(Fore. BLACK )
- print(Back.MAGENTA)
- print('Результат : ' + str(c))
- elif what =='***':
- c = a * a * a
- print(Back.WHITE)
- print('Результат : ' + str(c))
- elif what =='округление':
- c = round(a)
- print(Back.WHITE)
- print('Результат : ' + str(c))
- input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement