+ 2
The Python Input() Command
Why doesn’t the input() command work like it does normally, when you add text or a variable, it does not show up in the text box for visual aid, like it does in python’s IDLE launcher. Usually for example; if you add a string inside the input() command’s parentheses like input(“Enter your name: “), it does not show inside the input’s text box.
9 Antworten
+ 10
Sebastián Quevedo ,
the reason why the *input prompt* is not shown as expected is the behaviour of the sololearn input routine.
the playground can not work in an interactive mode. when using the input() function, a window pops up when running the code. we have to place all required inputs there in advance.
> to make sure that this is your issue, please link your code here,
+ 8
If I understood correctly your question for input(), below is the example I tried to give for strings and int.
Check out the code below:
https://code.sololearn.com/cb6QWLoJbgSk/?ref=app
+ 6
Sebastián Quevedo ,
thanks for showing your code.
from my point of view, the absence of interactivity is not a real problem in this particular code, since there are no loops used.
+ 3
Maybe this is intentional, but I still wonder why it was created this way.
+ 2
This problem just bugs me a bit cause the input command is entered in the return statement and not in the input box, so I had to modify my code to show the input statement in the return box.
I made a small example here: https://code.sololearn.com/co229Lp1842F/?ref=app
+ 1
Should be displayed, most likely you made some mistake... 🤔
+ 1
You put in a colon before the quotation mark so it won't work also to be simple the solo learn coding languages are only copies of the coding language and can miss some details and have some differences from the real coding language.
+ 1
Because the sololearn app uses an online compiler/interpreter
+ 1
I really would like sololearn to put up a warning explaining to users that they cannot use the input() function in the code playground like they normally would in an IDE, i.e. they can't do something like:
name = input('Name: ')
It's frustrating that it doesn't work. I understand there might be a reason why it doesn't work in the playground, but it is valid and pythonic to have a text prompt in the input function, so it either needs to work or there has to be an explanation for why it doesn't work.