Skip to main content

Posts

Featured

How to make a simple calculator with python

Hey guys! Welcome to my first blog post about python. Today im gonna show you how to make a calculator in Python! So first you will need a python editor or you can just go to online-python.com. after you go there it will show something like this- If you want dark mode click the moon button on the top right. then it will show something like this- Then you can click on the plus button to get a new tab or console. Then you can type the following code(remember do not start command with capital letter it wont work)  print("This is a calculator program made in python.")   num1 = int(input("Enter a number 1"))   num2 = int(input("Enter a number 2"))   operate = input("A,S,M or D")   if operate == "A":       total = num1 + num2       print("The sum of the two numbers is: ", total)   if operate == "S":       total = num1 - num2       print("The difference of two numbers is: ", total)   if operate == "M":  

Latest posts

A window to QBASIC programming language

Me and python

About me and my blogs