How to Create a Simple Calculator Program using Python ? Video Tutorial

preview_player
Показать описание
In this video tutorial you will learn How to create a simple Calculator Programming using Python Programming Language.
This video is well suited for the beginners.

The Calculator programming created here will first display the menu option to the user.
user can select the operation that he wants to perform.
( Addition, Subtraction, Multiplication, Division)
Then we take two numbers as input from the user
and then we display the result.

Here we are using the functions to create the operations of the calculator.

our Social Media Pages

Our Website

#PythonProgramming #ExampleProgram
Рекомендации по теме
Комментарии
Автор

from function import
while True:
print("what do you want to do")
print("1 Addition")
print("2 Subtraction")
print("3 Multiply")
print("4 Divide")
print("press Q key to Exit")

choice = input("Enter your choice:")

if choice =='q' or choice == 'Q':
break
num1 = float(input("Enter the Number 1 :"))
num1 = float(input("Enter the Number 2 :"))

if choice == '1':
add(num1, num2)
elif choice == '2':
subtract(num1, num2)
elif choice == '3':
Multiply(num1, num2)
elif choice == '4':
Divide(num1, num2)

terribryan
Автор

Hopefully I am the first person to comment here
I truly appreciate the work that u have done bro ...thanks for these programs ..very neat and clean programs
Please do make more such kind of interesting stuffs with PYTHON .... looking forward to learn those in python
Thank you

vishnuteja
Автор

while True:
print("What do you want to do")
print("1 Addition")
print("2 Subtraction")
print("3 Multiplication")
print("4 Division")

choice = input("Enter your choice :")
if choice == "q" or choice == "Q":
break

num1 = float(input("Enter Number 1 : "))
num2 = float(input("Enter Number 2 : "))

if choice == "1":
print("Result :" + str(num1 + num2))

elif choice == "2":
print("Result :" + str(num1 - num2))
elif choice == "3":
print("Result :" + str(num1 * num2))
elif choice == "4":
if num2 == 0:
print("Cannot divide by 0")
else:
print("Result :" + str(num1 / num2))
else:
print("Invalid Choice")

print("\n")

pricillaabuele
Автор

excellent! im taking a programming class soon. this truly was helpful!

LinuxBased_Eskimo
Автор

Thank you, great job keep them coming.

madhuhadas
Автор

This video is excellent. Definitely wins a follow

ErickAlex
Автор

it was great!
also you can .capitalize the input to simplify I think

It was very useful!

cruzrosasluisuriel
Автор

this was really cool to do, thank you . very easy to follow and not timeconsuming

adamartinmusic
Автор

Bro please make calculate with only if function and print function and choice too. Plz

indragupta
Автор

how to run this programm as i have written it in sublime text

Super.blazer
Автор

i didn't understand what is the * represent in import ??
i know that you want to import the functions files

omaribrahim
Автор

Can you teach, how we can make add this code to a App like UI.

ameenomar
Автор

You taught it very well, BTW are u from India?

stimmyKnuckle
Автор

This version did not work on sublime text, I had to modify it to get to work, very weird.
I wrote my own version it works fine on sublime, and it didn't work on VS code either until I modified it.

alwaysflat
Автор

this is a shorter version of the program and is a proper working 2 digit calculator :

#this is the simplest calculator you can make in python
n1 = float(input("enter the first number: "))
op = input("Enter the operator")
n2 = float(input("enter the second number: "))
if op == "+":
total = n1+n2


elif op == "/"
total = n1/n2


elif op == "-":
total = n1-n2


else:
total = n1*n2
print("The answer is: ", str(total))

muhammadahsanali-pqer
Автор

Bro i did everything right but when i pick the first and second number it says Invalid choice why is that

mahdi
Автор

It is showing error after i do the work
Like addition is not defined😢

mlcsgcm
Автор

What's the name of this application?

adityarakshit
Автор

when i apply the while loop it doest work

deekshaparmar
Автор

There is no real explanation of the use of format starting at 10:06 in the video.

we-are-electric
visit shbcf.ru