#### Code file as described in the video

``````# Exercise 2 - Faulty Calculator
# 45 * 3 = 555, 56+9 = 77, 56/6 = 4
# Design a calculator which will correctly solve all the problems except
# the following ones:
# 45 * 3 = 555, 56+9 = 77, 56/6 = 4
# Your program should take operator  and the two numbers as input from the user
# and then return the result
`````` mmishra at 2019-06-23 09:30:09 says
print("Enter 1st number:",end=" ") Number1 = int(input()) print("Enter 2nd number:",end=" ") Number2 = int(input()) print("Enter operator +,-,*,/ on numbers:",end=" ") Operator = input() if (Number1 == 45 and Number2 == 3 or Number1 == 3 and Number2 == 45) and Operator == '*': print(Number1, Operator, Number2, " = ", 7777) elif (Number1 == 56 and Number2 == 9 or Number1 == 9 and Number2 == 56) and Operator == '+': print(Number1, Operator, Number2, " = ", 77) elif (Number1 == 56 and Number2 == 6 or Number1 == 6 and Number2 == 56) and Operator == '/': print(Number1, Operator, Number2, " = ", 4) else: if Operator == '*': print(Number1, Operator, Number2, " = ",Number1*Number2) elif Operator == '+': print(Number1, Operator, Number2, " = ",Number1 + Number2) elif Operator == '-': print(Number1, Operator, Number2, " = ",Number1 - Number2) elif Operator == '/': print(Number1, Operator, Number2, " = ",Number1 / Number2) else: print("Unable to calculate, wrong operator") thakurabhi at 2019-06-23 09:30:09 says
print("Enter first number ") N1 = int(input()) print("Enter your operation + , - , / , * ") op = (input()) print("Enter 2nd number ") N2 = int(input()) if (N1 == 45 and N2 == 3 or N1 == 3 and N2 == 45) and op == '*': print(N1,op,N2, " = " , 555) elif (N1 == 56 and N2 == 4 or N1== 4 and N2 == 56) and op == '+': print(N1,op,N2, " = " , 77) elif (N1 == 56 and N2 == 6 or N1 == 6 and N2 == 5656) and op == '/': print(N1,op,N2, " = " , 4) else: if op == '+': print(N1,op,N2, " = ", N1 + N2) elif op == '*': print(N1,op,N2, " = ", N1 * N2) elif op == '/': print(N1,op,N2, " = ", N1 / N2) elif op == '-': print(N1,op,N2, " = ", N1 - N2) else: print("over") Manav_Seng at 2019-06-23 09:30:09 says Manav_Seng at 2019-06-23 09:30:09 says    