Return issue | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Return issue

It's seems like the return couldn't used after while right? https://code.sololearn.com/cPgNZW9HxGK0/?ref=app

29th Sep 2018, 12:10 PM
jill jealous
jill jealous - avatar
2 Answers
0
return should be used inside a function, but you aren't in a function. That has nothing got to do with the while loop :)
29th Sep 2018, 12:27 PM
fra
fra - avatar
0
return only works in functions, it returns variables to your main scope
29th Sep 2018, 12:28 PM
Kevin Dietrichstein
Kevin Dietrichstein - avatar