Faulty calculator using Python Last Updated : 01 Jul, 2021 Comments Improve Suggest changes Like Article Like Report A faulty calculator is simply a calculator which operates simple tasks, but in some cases (set by the programmer) it gives the wrong output. You all must be wondering why do we need a faulty calculator? This type of calculator is not needed unless you want to prank someone or prove them wrong in case of some maths problem. Approach: First, we take input from the user that what he/she wants to doThen we write the code of Addition, Subtraction, Multiplication, and DivisionAnd lastly, we insert those cases that we want wrong results. Implementation: Python print("what type of arithmetic operation you want to do?\n" "type + for addition\n" "type - for subtraction\n" "type / for division\n" "type* for multiplication\n") # taking input type_of_calculation = input() print("enter the first number") A = int(input()) print("enter the second number\n") B = int(input()) b = "+" c = "-" d = "*" e = "/" # setting normal and false condition for calculator if type_of_calculation == b: # for addition if (A == 53 and B == 9) or (A == 90 and B == 52): print(97) else: print(A+B) elif type_of_calculation == c: # for subtraction print(A-B) elif type_of_calculation == d: # for multiplication if A == 45 and B == 3 or A == 4 and B == 67: print(575) else: print(A*B) elif type_of_calculation == e: # for division if A == 5 and B == 63: print(40) else: print(A/B) Output: For normal condition For false condition Comment More infoAdvertise with us Next Article Faulty calculator using Python N nk7118491 Follow Improve Article Tags : Mathematical Project Python program DSA school-programming +2 More Practice Tags : Mathematicalpython Similar Reads Vegan Calculator using Python A vegan diet consists only of plant-based foods. It does not contain any animal products like meat, eggs, milk, honey, etc. A vegan lifestyle extrapolates this into not using day-to-day articles made up of animal products like leather, wool, silk, etc. A person observing this type of lifestyle is ca 2 min read Loan Calculator using PyQt5 in Python In this article, we will see how we can create a loan calculator using PyQt5, below is an image that shows how is the loan calculator will look like : PyQt5 is cross-platform GUI toolkit, a set of python bindings for Qt v5. One can develop an interactive desktop application with so much ease becaus 5 min read Calculator using PySimpleGUI - Python Prerequisite: PySimpleGUI, eval PySimpleGUI is a Python package that enables Python programmers of all levels to create GUIs. You specify your GUI window using a "layout" that contains widgets (they're called "Elements" in PySimpleGUI). In this article, we will learn, how to make a calculator using 2 min read Python | Loan calculator using Tkinter Prerequisite: Tkinter Introduction Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter outputs the fastest 5 min read Income Tax Calculator using Python In this article, We'll create a Python program that determines the income tax owed on a specific quantity of money. Please be informed that the income tax slabs are changed every year. Since income taxes vary from nation to nation, we have created a program that solely supports the Indian format and 2 min read Like