How to Build a Simple Calculator in Python - Step by Step 2

  Рет қаралды 18,465

Kindson The Tech Pro

Kindson The Tech Pro

5 жыл бұрын

How to Build a Simple Calculator in Python - Step by Step 2

Пікірлер: 32
@saintlavrent
@saintlavrent Жыл бұрын
personally what I've done, this was a useful tutorial import math print("Select an operation to perform: ") print("1. ADD") print("2. SUBTRACT") print("3. MULTIPLY") print("4. DIVIDE") print("5. SQUARE ROOT") print("6. RAISE TO POWER") operation = input() if operation == "1": # performs addition num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The sum of this calculation is: " + str(int(num1) + int(num2))) elif operation == "2": # performs subtraction num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The sum of this calculation is: " + str(int(num1) - int(num2))) elif operation == "3": # performs multiplication num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The sum of this calculation is: " + str(int(num1) * int(num2))) elif operation == "4": # performs division num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The sum of this calculation is: " + str(int(num1) // int(num2))) elif operation == "5": # performs square root num = int(input("Enter number: ")) print("The square root is %f " %(float(math.sqrt(num))) ) elif operation == "6": # square a number num = int(input("Enter number: ")) print("The power is %d " %(pow(num, 2))) else: print("Invalid Entry")
@user-wx3mg3oh2y
@user-wx3mg3oh2y 2 ай бұрын
Thank you man this is so good and useful
@user-ol7bq4ly1l
@user-ol7bq4ly1l 3 жыл бұрын
Thank you sir
@towsifsadab
@towsifsadab 10 ай бұрын
where’s the video of creating web interface and running this calculator into it?
@jingyin1149
@jingyin1149 10 ай бұрын
Good calculator
@Xidas_aventures
@Xidas_aventures 8 ай бұрын
on raise to the power add second line of code asking "what would you like the power to be" and instead of the (num1, 2) you can do (num1, num2)
@divinepeace8924
@divinepeace8924 2 жыл бұрын
I've inputed all but when I run my code, it's saying Type error: float is required
@beyondtemptationswithrida8787
@beyondtemptationswithrida8787 8 ай бұрын
thankyouuuuuuuuuuuuu
@faizankhan-ev6it
@faizankhan-ev6it 17 күн бұрын
Can any one tell me how to add the number in b/w the line like print(The square of NUM is %f"
@tondoewtw
@tondoewtw 2 жыл бұрын
Full Calculator - import math print("Select an operation to perform: (1 - 6") print("1. ADD") print("2. SUBTRACT") print("3. MULTIPLY") print("4. DIVIDE") print("5. SQUARE ROOT") print("6. RAISE TO POWER") operation = input() if operation == "1": # PERFORM ADDITION num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The sum is " + str(int(num1) + int(num2))) elif operation == "2": # PERFORM SUBTRACTION num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The difference is " + str(int(num1) - int(num2))) elif operation == "3": # PERFORM MULTIPLICATION num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The product is " + str(int(num1) * int(num2))) elif operation == "4": # PERFORM DIVISION num1 = input("Enter first number: ") num2 = input("Enter second number: ") print("The result is " + str(int(num1) / int(num2))) elif operation == "5": # SQUARE ROOT num = int(input("Enter number: ")) print("The square root is %f " %(math.sqrt(num)) ) elif operation == "6": # RAISE TO POWER num = int(input("Enter number: ")) print("The power is %d " %(math.pow(num, 2)) ) else: print("Invalid Entry")
@divinepeace8924
@divinepeace8924 2 жыл бұрын
Thanks. This helped a lot💯
@BennTresor-yj4mv
@BennTresor-yj4mv Жыл бұрын
I have a small probleme in square root wnt i put "math" there are show me dat is undefined
@tondoewtw
@tondoewtw Жыл бұрын
@@BennTresor-yj4mv show me your code
@BennTresor-yj4mv
@BennTresor-yj4mv Жыл бұрын
It thesame one you wrote
@memabe7629
@memabe7629 3 жыл бұрын
Hi sir I need to develop a python program in anaconda to run an application like calculator or clock or any other applications if u have them in ur mind please suggest sir. Also how am I going to do it ?
@KindsonTheTechPro
@KindsonTheTechPro 3 жыл бұрын
I'm working on this. Remember to subscribe so you can get notified when published
@memabe7629
@memabe7629 3 жыл бұрын
@@KindsonTheTechPro is a quiz also an application?
@memabe7629
@memabe7629 3 жыл бұрын
@@KindsonTheTechPro reply please
@KindsonTheTechPro
@KindsonTheTechPro 3 жыл бұрын
@@memabe7629 yes, a quiz can be build as an application.
@zipzopebinay
@zipzopebinay 10 ай бұрын
​@@KindsonTheTechPro sir , When will you uplode step 3 ??
@ragavaviraji4094
@ragavaviraji4094 Ай бұрын
Where is part three?? I guess he didn't upload it yet......even after 5 YEARS!!!!
@anondebennett9219
@anondebennett9219 7 ай бұрын
Hy where is the follow up video to this one
@shaheersyed5818
@shaheersyed5818 2 жыл бұрын
How to repeat a f Program
@rikka7465
@rikka7465 Жыл бұрын
So, if someone is looking for a code which raises x to the power of n while x and n are inputs from the user, here is it: elif operator == "6": # power of a number number_1 = input("What's your base number?: ") number_2 = input("What's your exponential number?: ") print("The sum is:" + str(float(number_1) ** float(number_2))) For me it didn't make sense to use pow( ) without a second number since it one, didn't work for me and two, I would like to user to choose their base and exponential number by themselves. Overall, good video thank you.
@BennTresor-yj4mv
@BennTresor-yj4mv Жыл бұрын
If its possible pls let me knw
@jingyin1149
@jingyin1149 10 ай бұрын
😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮😮
@BennTresor-yj4mv
@BennTresor-yj4mv Жыл бұрын
Hi please i want to in box you if u dnt mind
@ragavaviraji4094
@ragavaviraji4094 Ай бұрын
WHO WANT PART THREE like this comment Edit: I never got more than 1 like please like this comment
@Itsthekra
@Itsthekra Жыл бұрын
Where is part three
@sohamharitash3641
@sohamharitash3641 Жыл бұрын
no part three yet
@beyondtemptationswithrida8787
@beyondtemptationswithrida8787 8 ай бұрын
i wanted so bad :((((((((((((((((((((((((((
@ragavaviraji4094
@ragavaviraji4094 2 ай бұрын
I'm from 2024 and this video was uploaded 5 yrs ago and still.....still part 3 has NOT been UPLOADED!!!!
Simple GUI Calculator in Python
22:51
NeuralNine
Рет қаралды 235 М.
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 333 М.
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 53 МЛН
Последний Закат Кота Макса...
00:21
Глеб Рандалайнен
Рет қаралды 7 МЛН
How many pencils can hold me up?
00:40
A4
Рет қаралды 13 МЛН
顔面水槽がブサイク過ぎるwwwww
00:58
はじめしゃちょー(hajime)
Рет қаралды 117 МЛН
Build a Website in only 12 minutes using Python & Streamlit
12:48
Coding Is Fun
Рет қаралды 511 М.
How to Build a Simple Calculator in Python - Step by Step 1
15:37
Kindson The Tech Pro
Рет қаралды 350 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 242 М.
Python Program #30 - Make a Simple Calculator in Python
10:19
Programming For Beginners
Рет қаралды 7 М.
How To Use Functions In Python (Python Tutorial #3)
14:55
CS Dojo
Рет қаралды 2,3 МЛН
Python calculator app 🖩
15:08
Bro Code
Рет қаралды 65 М.
Python calculator program 🧮
3:55
Bro Code
Рет қаралды 119 М.
👩‍💻 Python for Beginners Tutorial
1:03:21
Kevin Stratvert
Рет қаралды 3 МЛН
Learn Python With This ONE Project!
55:04
Tech With Tim
Рет қаралды 1,6 МЛН
Приехала Большая Коробка от Anker! А Внутри...
20:09
РасПаковка ДваПаковка
Рет қаралды 81 М.
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 4 МЛН
Samsung or iPhone
0:19
rishton vines😇
Рет қаралды 8 МЛН
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 1,8 МЛН
IPad Pro fix screen
1:01
Tamar DB (mt)
Рет қаралды 4,2 МЛН