how to make basic calculator with python

preview_player
Показать описание
#python
#codewithharry
#pythoncalendar
#programingwithmosh
#technologygyam
#apnacollage
#simplesnnipad
#calculator
#vscode
#basicpython
#tech
#basicknowledge

music : dream to bensound
Рекомендации по теме
Комментарии
Автор

Thank you so much! Can you make more videos like this? 😃

FarmingJD-MF
Автор

I also made calculator but ...
x=int(input(" Number --> "))
z=input(" Operation --> ")
y=int(input(" Number --> "))
print(x, z, y)
if z== "+":
print("=", x+y)
elif z=="-":
print("=", x-y)
elif z=="/":
print("=", x/y)
elif z=="×":
print("=", x*y)
else:
print("end")

sachinsharma
Автор

I did 76 lines of code....
import time

print(""" >[Welcome to your calculator]<""")
time.sleep(0.6)
print("""
""")
print("""Symbol Instructions:
[Addition is + Symbol]
[Subtraction is - Symbol]
[Multiplication is * Symbol]
[Division is / Symbol]
[Power is ** Symbol]
[Division's remainder is % Symbol]
[Division's Quotient is // Symbol]

""")
time.sleep(0.5)
while True:
Operator = input("[Choose one of these operators to calculate: +, -, *, /, //, **, %.] Digit the symbol right here: ")
print("""
""")
time.sleep(0.2)
First_Number = float(input("[Enter your first number right here]: "))
print("""
""")
time.sleep(0.2)
Second_Number = float(input("[Enter your second number right here]: "))
print("""
""")
time.sleep(0.5)
if Operator == '+':
print("[Here's your answer]:")
print(First_Number, "+", Second_Number, "=", First_Number + Second_Number)
elif Operator == '-':
print("[Here's your answer]:")
print(First_Number, "-", Second_Number, "=", First_Number - Second_Number)
elif Operator == '*':
print("[Here's your answer]:")
print(First_Number, 'x', Second_Number, '=', First_Number * Second_Number)
elif Operator == '/':
print("[Here's your answer]:")
print(First_Number, '÷', Second_Number, '=', First_Number / Second_Number)
elif Operator == '//':
print("[Here's your answer]:")
print(First_Number, '/', Second_Number, '=', First_Number // Second_Number)
elif Operator == '**':
print("[Here's your answer]:")
print(First_Number, '*', Second_Number, '=', First_Number ** Second_Number)
elif Operator == '%':
print("[Here's your answer]:")
print(First_Number, '%', Second_Number, '=', First_Number % Second_Number)
else:
print("[Invalid Operator]")
print("""
""")
time.sleep(0.35)
Repeat = input("[Do you want to execute this program again?]: ")
if Repeat == 'yes':
print("""
""")
print("[Executing....]")
time.sleep(0.5)
elif Repeat == 'Yes':
print("""
""")
print("[Executing....]")
time.sleep(0.5)
else:

print("[Have a good day.]")

time.sleep(0.5)
print("[Finishing
time.sleep(1)
break
print("""
""")

MandelbrotWorm
Автор

This is good in concept, but the fact that it is using eval makes it vulnerable to attacks, never use eval!

lapispheonix
Автор

which version are you using mine looks different

surayedits
Автор

It is not work in idle python gui in new window why?

pranshi_tyagi_
Автор

That's not 'Hot to make calculator'. That's 'How to use calculator' because you arent coding a calculator. You are coding something that uses the calculator which has been before.

Usarda
Автор

Bruh Can you describe what The words an all of these means

przemo
Автор

What is I ask who is the 3rd president of US?


Don't make wrong titles

GamesindieSR
welcome to shbcf.ru