Skip to content
Sign upLog in
← Back to Community

Calculator

Profile icon
ProCode1227

A simple calculator for simple people. Without a calculator, i don't know what i would do in math. Probably fail...

Voters
Profile icon
LucasMin
Profile icon
atharvpopli
Profile icon
Mehrael-GeorgeG
Profile icon
VladVolokovy
Profile icon
EvanWalter2
Profile icon
ConorDelk
Profile icon
HamadKhaled6
Profile icon
EthanJones33
Profile icon
3B06HO
Profile icon
3011273
Comments
hotnewtop
Profile icon
cecook1022
Profile icon
Bookie0

Hi,

You should add an error message if someone types a random thing like a parentheses.

Anyway good work

Have a great day
A0014F49-21FB-4056-BFA7-26DF57EEF01A

Profile icon
ProCode1227

@Bookie0
Thanks for the feedback!

Profile icon
Bookie0

@ProCode1227
it’s a pleasure

Profile icon
DaCuteRaccoon

@Bookie0
Just saying, ProCode1227 didn't do good work. It is completely plagiarized from https://www.programiz.com/python-programming/examples/calculator, and it doesn't even mention something about the website.

Profile icon
3465728974563

I made my own calculator a while ago and this one has solve for x. Unfortunately it doesn't actually print the equation that you put in because I'm too lazy. Anyway the link to my calculator is https://repl.it/@3465728974563/Calculator if you want to use it. The solve for x took way too long and was a pain to make and I'm still trying to find anything I can add or improve to it.

Profile icon
Capix

Divide -> 0 -> need an error message ;)

Profile icon
ShibePlanetDSA

Delete lines 37-50, they're copies of the other lines

Profile icon
ProCode1227

@AlexRamirez2
ight. Can you get on The adventure thing we were doing pls. i need help

Profile icon
ShibePlanetDSA

You duplicated part of your code while updating O.o

Profile icon
ProCode1227

@AlexRamirez2
I am doing some code, called adventure game. Would you want to help? I see your good at python!

Profile icon
ShibePlanetDSA

@ProCode1227
Sure! I'm actually working on a zombie game right now.

Profile icon
ProCode1227

@AlexRamirez2
Cool! We can help each other!

Profile icon
ShibePlanetDSA

@ProCode1227
Just invite me and I'll get on soon.

Profile icon
ShibePlanetDSA

Division by zero error, I reccomend putting a try function to prevent errors from appearing and messing up the script.

try: choice = input("Enter choice(1/2/3/4): ") num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) if choice == '1': print(num1,"+",num2,"=", add(num1,num2)) elif choice == '2': print(num1,"-",num2,"=", subtract(num1,num2)) elif choice == '3': print(num1,"*",num2,"=", multiply(num1,num2)) elif choice == '4': print(num1,"/",num2,"=", divide(num1,num2)) else: print("Invalid input") except: print("An error occured!")
Profile icon
ProCode1227

@AlexRamirez2
Wow, thanks! I will put that in right now!

Profile icon
ProCode1227

@Alexramirez2
I think that i fixed it. Thanks again!

Profile icon
ProCode1227