Problem with readline method | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Problem with readline method

when we write writeline method with a line asking for input before readline method we actually expect to be asked for input then inter input but actually what happens when executing code is we first enter input and then system print asking line for input at the end while we expect to see it just before inputing data to ask user for specific data. why i have this problem?

25th Aug 2017, 2:00 PM
Babak a
Babak a - avatar
2 Answers
+ 6
You have that problem because you're using the Code Playground, rather than a "real" compiler. SoloLearn is set up to ask for ALL inputs in the beginning, and then execute your code. Without going into details, it's a necessary security measure for them to regulate/limit their compiler since it's open for the public to post/share anything on it. If you do the same thing in another compile (Visual Studio, for example), then it'll work as you expect it to. Hope that helps!
25th Aug 2017, 2:06 PM
AgentSmith
0
That helped a lot thank you.
25th Aug 2017, 2:09 PM
Babak a
Babak a - avatar