Hello everyone, why does this code run on my laptop and not on SOLOLEARN?Or i probably made an error somewhere ? Pls let me know | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hello everyone, why does this code run on my laptop and not on SOLOLEARN?Or i probably made an error somewhere ? Pls let me know

https://code.sololearn.com/c36Z6S8y2L27/?ref=app

17th Sep 2021, 7:54 PM
Ladzani Bengane
Ladzani Bengane - avatar
4 Answers
+ 3
Ladzani Bengani , you have a do...while loop running. in playground this needs all inputs in advance. in a regular IDE it is interactive. ▪︎if input is the correct password, the code runs as expected ▪︎if input is not correct, the loop repeates. 1. incorrect, 2. incorrect, 3. incorrect => will work and outputs the expected message 1. incorrect, 2. correct will also work i think your code is ok, it is just the behavior of playground.
17th Sep 2021, 8:36 PM
Lothar
Lothar - avatar
0
Here you should set all data input at start the code for example: Guio Vhjkl 76543
17th Sep 2021, 8:18 PM
JaScript
JaScript - avatar
0
I set the string variable: password to "1234";
17th Sep 2021, 8:21 PM
Ladzani Bengane
Ladzani Bengane - avatar
0
Yes, I know it. When you set the input here on SL to for example: 1234 or: Ghjk 1234 or: Gjk p875 1234 then it will work too.
17th Sep 2021, 8:27 PM
JaScript
JaScript - avatar