+ 2

What is the peoblem?

Hi! This code is in 21_1 lesson(basic calculator) It wil take user inputs and give their sum as the output but it doesn't work!:/ Do you know why? https://code.sololearn.com/c4wVeKvFfPyA/?ref=app

1st May 2022, 12:15 PM
Mammad
7 Réponses
+ 3
It works, but the input is odd. Example of working input: e (this can be any string) 3 4 exit (to stop the program) Then submit.
1st May 2022, 12:33 PM
Paul
Paul - avatar
+ 1
It is your first readline. It wants something in every loop. And if you don't want to exit you have to give it something else.
1st May 2022, 12:57 PM
Paul
Paul - avatar
0
Paul thanks for your help 🙏 But why it doesn't work like this?: 3 4 exit
1st May 2022, 12:40 PM
Mammad
0
Mammad For your expected way, Cut lines 16,17,18 and paste after result print. At after, Line no:23
1st May 2022, 1:29 PM
Jayakrishna 🇮🇳
0
Jayakrishna🇮🇳 thank you so much
1st May 2022, 1:35 PM
Mammad
0
You're welcome.. Mammad
1st May 2022, 1:43 PM
Jayakrishna 🇮🇳
- 1
BroFar Sorry to bother you 😔 Could you help me please?
1st May 2022, 12:22 PM
Mammad