The python input examples are incorrect | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

The python input examples are incorrect

the examples say input("Enter something please: ") what leads to output "Enter something please: plus whatever you typed. its meant to be a input box with the text Enter something please: and the output should be the input provided only so without the text Enter something please: . how should the code look like to make it work in the proper way?

29th Mar 2018, 2:05 PM
Jeroen Seijsener
Jeroen Seijsener - avatar
5 Réponses
+ 8
In a live Python shell, it is supposed to display a line which prompts you to input something. However, Code Playground does not provide a live console, and hence it would seem redundant. In reality, it isn't.
29th Mar 2018, 2:10 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
I know, which is why I made clear in my previous post that Code Playground does not support live console for console apps. Just because it doesn't work here does not mean it doesn't work on a Python shell. The text has nothing to do with the input box. Code Playground simply has to receive all input prior to code interpretation.
29th Mar 2018, 4:23 PM
Hatsy Rei
Hatsy Rei - avatar
0
Hatsy Rei or the application is faulty or the code, try it in the app and you will see it does not work ;).
29th Mar 2018, 4:18 PM
Jeroen Seijsener
Jeroen Seijsener - avatar
0
Hatsy Rei my first steps in Python so makes it difficult for me that the Playground is not working properly. Thank you for clearing things up for me. Did not understand that Playground is this app ;), sorry for that!
29th Mar 2018, 7:06 PM
Jeroen Seijsener
Jeroen Seijsener - avatar
0
just installed the app qpython3 to test the code and that gave me some insight. the : is mandatory and the code example gives nothing back bacause its incomplete. the example is float(input("Enter a number: ")) + float(input("Enter another number: ")) Enter a number: 40 Enter another number: 2 42.0 to actually produce output (in this case 42.0) it should start with print( can this be fixed in the app? this makes it hard to learn for newbies like me ;).
30th Mar 2018, 11:04 AM
Jeroen Seijsener
Jeroen Seijsener - avatar