Created
March 8, 2017 10:47
-
-
Save d3174/225ed0d7fe5b8e5ec02fa85326eb64c4 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
print ('Приветствуем вас в калькуляторе Python') | |
q1 = int (input('Введите число 1: ')) | |
q2 = int (input('Введите число 2: ')) | |
v = int (input('Какую операцию вы хотите выполнить? \n 1 Сложение \n 2 Вычитание \n 3 Деление \n 4 Умножение \n')) | |
if v == 1: | |
r = q1 + q2 | |
p = 'сложения' | |
t = p | |
if v == 2: | |
r = q1 - q2 | |
l = 'вычитания' | |
t = l | |
if v == 3: | |
r = float(q1 / q2) | |
m = 'деления' | |
t = m | |
if v == 4: | |
r = q1 * q2 | |
n = 'умножения' | |
t = n | |
print ('Результат ',t,' = ',r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
на функції try помилка і далі не працює