I'm not getting correctly python simple calculator. What is the correct way of doing it. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm not getting correctly python simple calculator. What is the correct way of doing it.

I've first tried it myself with while loop but 8 know it is not correct.plz explain 👇 https://code.sololearn.com/c9oZWUgRqafJ/?ref=app

30th Jul 2020, 6:33 AM
riya charles
riya charles - avatar
8 Answers
+ 3
The indentation is all wrong. See the code again. Also, what have you done in the conditions of the if statements?? What is user_input() function?? Please specify if this is a pseudo code or a proper code.
30th Jul 2020, 6:37 AM
XXX
XXX - avatar
+ 2
Wally please don't give direct solutions to the asker. We should only guide them, and then let them learn and solve the problem on their own.
30th Jul 2020, 8:16 AM
XXX
XXX - avatar
+ 2
Sorry 😅
30th Jul 2020, 10:48 AM
Wally
Wally - avatar
+ 1
Did you write this code?? If yes, then please specify what you have done so that your doubts can be cleared. If no, then I won't give you the full code. But this is what you have to do. 1. Start an infinite loop. 2. Inside the loop, ask for 3 inputs (2 numbers and 1 operator) 3. Use if statements to check which operator was entered by the user and act accordingly. 4. Ask for input if the user wants to calculate again. If user enters 'n', break the loop
30th Jul 2020, 6:47 AM
XXX
XXX - avatar
0
Can u plz share your code so that I can see the correct way of doing it. I'm a beginner and I am getting difficulty in understanding it.
30th Jul 2020, 6:42 AM
riya charles
riya charles - avatar
0
Alright..
30th Jul 2020, 6:52 AM
riya charles
riya charles - avatar
0
Thanks Wally
30th Jul 2020, 8:10 AM
riya charles
riya charles - avatar
0
I'm sorry.....XXX I think you're right this makes us better in programming 🙏🙃😔
30th Jul 2020, 8:46 AM
riya charles
riya charles - avatar