please explain the output for this code
Need help with a code's output
hey @devchopra999_11c6416ab7f09bbf ,
whats the problem in this ? please tell me what you are not able to understand.
sir i am unable to understand the flow of control in this program bcz i dont know the function end=" " and what did continue do when encountering “O”
by default on calling the print function , it moves you to next line in output screen , to change that nature we use end parameter , so be default it is \n and hence we are moved to next line , so here we are changing that and hence this , you can see it functioning by changing it to some other value.
continue returns to next iter of the loop , so if there is something after the continue call , it skips that and then back to next iteration.
I hope this helps.
Thanks it was helpful !
so in this code the
if i==‘O’:
continue
statement is useless right?
Yeah absolutely.
But to just learn it ,
try printing after the continue , out of the if condition , and see how it works.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.