-
Notifications
You must be signed in to change notification settings - Fork 0
/
faulty calculator.py
32 lines (31 loc) · 1.04 KB
/
faulty calculator.py
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
#faulty calculator.
repeat='y'
while repeat=='y'or repeat=='Y':
print("welcome to faulty caculator some values in this calculator will shows wrong results")
x = int(input("enter your first number="))
y = int(input("enter your second number="))
ch = input("what do you want to do sum(+), multiply(*), divide(/), substract(-)=")
if ch == 'sum' or ch == "+":
if x == 56 or y == 9:
print("77")
else:
print("the sum is=", x + y)
elif ch == 'multiply' or ch == '*':
if x == 45 or y == 3:
print("555")
else:
print("the product is", x * y)
elif ch == 'divide' or ch == '/':
if x == 56 or y == 6:
print("4")
else:
print("the divide is", x / y)
elif ch == 'substract' or ch == '-':
if x == 40 or y == 6:
print("78")
else:
print("the subtraction is", x - y)
else:
print("invalid information!!")
repeat=input("do you want more calculations y/n=")
print("thanks for using")