+ 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?
5 Respostas
+ 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.
+ 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.
0
Hatsy Rei or the application is faulty or the code, try it in the app and you will see it does not work ;).
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 ;).