0
Can anyone please tell me how to create a simple calculator in python?
13 Answers
+ 2
Sorry I meant tip calculator
+ 2
Thanks I got the answer
+ 1
Then edit it to make it more effective but please just don't copy it(most sololearners copy codes)(sorry for If you find rudeness)
0
Yeah, you take 2 numbers as input then put an operator between them and print out the solution.
0
WINNER Then search for tip calculator on Google, Sololearn. etc
0
I didn't copy I kind of just got an hint
0
but i can show you a simple c++ calculator ! ask me anytime (-: !
- 1
Sure, what exactly are you struggly with
- 1
theres nothing wrong with snatching
some code every once in a while
- 1
Google search
- 1
How to make simple calculator
- 2
def calculator(op,num1,num2):
if op == '+':
return num1+num2
if op == '-':
return num1-num2
if op == '*':
return num1*num2
if op == '/':
return num1/num2
def main():
num1 = int(input("Insert num1: "))
print(num1)
num2 = int(input("Insert num2: "))
print(num2)
op=input("Insert operation symbol: +,-,*,/")
print(op)
res=calculator(op,num1,num2)
print("The result is: ",res)
main()