Last active
September 4, 2020 20:41
-
-
Save solaris-ventus/6c9ca263d6f6c863d16df82da4c7ca77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = input('введите первое число: ') | |
b = input('введите второе число: ') | |
c = input('введите переменную: ') | |
if c == '+': | |
print(float(a)+float(b)) | |
elif c == '-': | |
print(float(a)-float(b)) | |
elif c == '*': | |
print(float(a)*float(b)) | |
elif c == 'pow': | |
print(float(a) ** float(b)) | |
elif c == '/' and b!=0: | |
if float(b) == 0: | |
print('Деление на 0!') | |
exit(1) | |
print(float(a)/float(b)) | |
elif 'div' and b == 0: | |
if float(b) == 0: | |
print('Деление на 0!') | |
exit(1) | |
print(float(a)//float(b)) | |
elif c =='mod' and b != 0: | |
if c =='mod' and float(b) == 0: | |
print('Деление на 0!') | |
exit(1) | |
print(float(a)%float(b)) | |
else: | |
print('Неверная опперация') | |
exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment