+ 1

In code playground, it is throwing an error for type conversion

In code playground, it is throwing an error for these steps - 1. Entered this code in the code playground: print(float(input("Enter a number: ")) + float(input("Enter another number: "))) 2. Entered 40 and no other pop up to ask another number comes. 3. Output : Enter a number: Enter another number: Traceback (most recent call last): File "..\Playground\", line 1, in <module> \ufeffprint(float(input("Enter a number: ")) + float(input("Enter another number: "))) EOFError: EOF when reading a line

19th Nov 2018, 10:58 AM
Deven
Deven - avatar
3 Respostas
+ 5
Deven, when input is entered for a python programme it needs to be entered on consecutive lines in the pop up before the script runs So if you need two inputs you enter the first, go to a new line in the pop up and then enter the second number. The code should then work. Hope that helps.
19th Nov 2018, 11:24 AM
Richard Myatt
Richard Myatt - avatar
+ 3
The reason behind it sololearn playground is not live ide.your code is run on sololearn servers then servers come back the output.so all the inputs should be enter at once time simultaneously.you can not enter multiple inputs at different times in sololearn like in pc. If you want to work with live ide for android then you should install pydroid3 on Android available on play store.
19th Nov 2018, 4:14 PM
Maninder $ingh
Maninder $ingh - avatar
+ 1
Hello Richard. Thank you for the explanation. I understood. I was actually entering only the number 40 as the prompt and I submitted it. Instead I should have entered two numbers on the prompt with an Enter button.
19th Nov 2018, 11:59 AM
Deven
Deven - avatar