r/learnpython • u/Elegant_Rise356 • Oct 22 '26
I'm trying to make a basic calculator in python but I can figure out what I'm doing wrong
Here is my code if you can figure it out pls help
print ("Caculator")
print ("Addition, only")
print ()
no1 = input ("Enter 1st Number: ")
no2 = input ("Enter 2nd Number: ")
print ()
print ("Answer")
print (no1, "+", no2, "=", no1 + no2)
0
Upvotes
12
u/Anxious_Signature452 Oct 22 '26
You need to covert strings to numbers. Ints probably.
print (no1, "+", no2, "=", int(no1) + int(no2))3
u/nivaOne Oct 22 '26
String versus integer
Check the input command theory again. 👍
1
u/TheRNGuy Oct 23 '26
Using input and print instead of UI.
0
u/AlexMTBDude Oct 22 '26
When you ask questions like these you need to tell us what goes wrong, meaning what error message are you getting, or what is not working as it should. Otherwise it's very hard to help you.
-5
u/-boo-- Oct 22 '26
https://share.gemini.google/bF0c2l5qgfSu