-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15_exercise.py
More file actions
59 lines (56 loc) · 1.49 KB
/
Copy path15_exercise.py
File metadata and controls
59 lines (56 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Faulty Calculator
# 45 * 3 = 555, 56 + 9 = 77 , 56/6 = 47
# num1 = int(input("Enter your number1 "))
# num2 = int(input("Enter your number2 "))
# add = (f"{num1} + {num2} = {num1 + num2} ")
# sub = (f"{num1} - {num2} = {num1 - num2}")
# mul = (f"{num1} * {num2} = {num1 * num2}")
# div = (f"{num1} / {num2} = {num1/num2}" )
# a = [add, sub, mul, div]
# print(input("Enter your sumbol"))
# if a == add:
# if num1 == 56 and num2 == 9:
# print("77")
# else:
# print(num1+num2)
# elif a == sub:
# print(num1 - num2)
# elif a == mul:
# if num1 == 45 or num2 == 3:
# print("555")
# else:
# print(num1*num2)
# elif a == div:
# if num1 == 56 or num2 == 6:
# print(47)
# else:
# print(num1/num2)
# else:
# print("invalid input")
x = int(input("Enter your first number:\n"))
print("press + for Additon")
print("press - for subraction")
print("press * for multiple")
print("press / for divide")
a = input()
y = int(input("Enter your secound number:\n"))
if a== "+" or a == "-" or a =="*" or a=="/":
if a=="+":
if x == 56 and y ==9:
print("77")
else:
print(x+y)
if a=="-":
print(x-y)
if a =="*":
if x ==43 and y ==3:
print("555")
else:
print(x*y)
if a =="/":
if x == 56 and y == 6:
print("57")
else:
print(x/y)
else:
print("invalid format")