Skip to content

Instantly share code, notes, and snippets.

@solaris-ventus
Last active September 4, 2020 20:41
Show Gist options
  • Save solaris-ventus/6c9ca263d6f6c863d16df82da4c7ca77 to your computer and use it in GitHub Desktop.
Save solaris-ventus/6c9ca263d6f6c863d16df82da4c7ca77 to your computer and use it in GitHub Desktop.
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