New course! Every coder should learn Generative AI!
Try a free lesson0
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
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.
0
Here you should set all data input at start the code for example:
Guio
Vhjkl
76543
0
I set the string variable: password to "1234";
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.