The Python Input() Command | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

4th Apr 2023, 10:36 PM
Sebastián Quevedo
Sebastián Quevedo - avatar
9 Answers
+ 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,
5th Apr 2023, 6:15 AM
Lothar
Lothar - avatar
+ 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
5th Apr 2023, 12:03 AM
D Shah 🎯⏳️
D Shah 🎯⏳️ - avatar
+ 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.
18th Apr 2023, 2:06 PM
Lothar
Lothar - avatar
+ 3
Maybe this is intentional, but I still wonder why it was created this way.
4th Apr 2023, 10:37 PM
Sebastián Quevedo
Sebastián Quevedo - avatar
+ 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
17th Apr 2023, 6:44 PM
Sebastián Quevedo
Sebastián Quevedo - avatar
+ 1
Should be displayed, most likely you made some mistake... 🤔
4th Apr 2023, 11:50 PM
Solo
Solo - avatar
+ 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.
6th Apr 2023, 12:00 AM
Srihan Ghoshal
Srihan Ghoshal - avatar
+ 1
Because the sololearn app uses an online compiler/interpreter
6th Apr 2023, 10:13 PM
Z3ro
+ 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.
23rd Apr 2024, 7:01 AM
Alexander Puntigam
Alexander Puntigam - avatar