0
Can u plz help me make calculator with python language, thx
8 ответов
+ 3
Shogher Frangulyan
Start with 3 inputs:
num1
num2
operator
Then write a code which identifies the operator, and the actions that operator has on the 2 nums.
You can do this with if, elif, else statements or by creating a dictionary.
There are lots of examples posted on Sololearn
+ 1
But how?
+ 1
I will give an advice to start with:
operation= input()#enter the full operation i.e 5+4, 89*7..
and then check if the plus operator "+" is in the operation, if it's the case, then use +
elif check for / and * and so on ...
it's easy just try with it!
good luck !
+ 1
Let me give you an example
https://code.sololearn.com/cctAihtplABa/?ref=app
+ 1
∆BH∆Y Thanks, but I learnt this technique from Sololearn, so the credit goes to the community.
🖐😁👍