0

Problems with input function

Does anyone have problems with input function? The app don't run the code and don't show the out put when I use a string in the input function. Like, when I write n = input (), everything is ok, when I add n = input ("Enter your name") code doesn't run.

29th Jan 2022, 12:18 PM
Oksana K.
Oksana K. - avatar
26 Réponses
+ 10
Sololearn console is not a real console. Input is only accepted once by the app, so getting multiple inputs needs some workaround. And don't bother with input prompts n = input("Your input instructions") because they are displayed AFTER the input is submitted. Just use n = input() and put instructions on comments at the beginning of your code so people would know what to type in. It is weird, but maybe not exposing the console is a safety concern.
30th Jan 2022, 7:01 AM
Bob_Li
Bob_Li - avatar
+ 5
The code works fine here in SoloLearn app.
29th Jan 2022, 12:45 PM
JaScript
JaScript - avatar
+ 4
Code works for me. I just entered my name and it prints "Hello, Ipang" Did you get any error message?
29th Jan 2022, 12:30 PM
Ipang
+ 4
Okay, I'm totally lost here cause I didn't have any problem when running it in SoloLearn (Android) app.
29th Jan 2022, 12:40 PM
Ipang
+ 4
Ok, I fix the problem with first one, it was in permission to the app.
29th Jan 2022, 12:54 PM
Oksana K.
Oksana K. - avatar
+ 4
Oksana I mean just LOL it off cause we all do silly things sometimes. It's part of learning 👌
29th Jan 2022, 2:42 PM
Ipang
29th Jan 2022, 12:27 PM
Oksana K.
Oksana K. - avatar
+ 3
Oksana LOL 😁
29th Jan 2022, 12:57 PM
Ipang
+ 3
Ipang, yep😅 Newby🤷🏼‍♀️
29th Jan 2022, 12:59 PM
Oksana K.
Oksana K. - avatar
+ 3
Every is working fine.
31st Jan 2022, 3:54 AM
Abu Habban
Abu Habban - avatar
+ 2
Attach a link to the code in your thread Description for diagnostic purpose https://www.sololearn.com/post/75089/?ref=app
29th Jan 2022, 12:24 PM
Ipang
+ 2
Hmm, i also have Android. Maybe that's because of security settings on popups. I'll try to check
29th Jan 2022, 12:42 PM
Oksana K.
Oksana K. - avatar
+ 2
Same with me
30th Jan 2022, 1:46 AM
Lolcoder
Lolcoder - avatar
+ 2
I found out that if you need several input, you write them in the code and when input prompt appears, you can write them in separate lines and it works.
30th Jan 2022, 7:08 AM
Oksana K.
Oksana K. - avatar
+ 2
just don't put any text inside the input. they are useless in Sololearn. Place the instructions inside comments instead.
30th Jan 2022, 7:09 AM
Bob_Li
Bob_Li - avatar
+ 2
Oksana K. You wrote: when I add n = input ("Enter your name") code doesn't run. Try n = input(“Enter your name: “) You need to leave a space after “Enter your name: and before the closing quotes“. That way it has room to enter input. So instead of “abc”, you will have “abc “. Hope that makes sense 😀
30th Jan 2022, 11:45 PM
Gina
+ 2
The string in your input bracket will be displayed in line with the output not at time of input
31st Jan 2022, 9:17 AM
Keith Izett
Keith Izett - avatar
+ 1
First it doesn't show the string that I wrote in brackets after input. Anyway I write my name, but then just nothing happens
29th Jan 2022, 12:35 PM
Oksana K.
Oksana K. - avatar
+ 1
I've tried the same code on laptop and everything works. But in the app it doesn't
29th Jan 2022, 12:36 PM
Oksana K.
Oksana K. - avatar
29th Jan 2022, 12:54 PM
Oksana K.
Oksana K. - avatar