+ 1
I dont understand continue,break and return in python.
plz help
3 odpowiedzi
+ 2
In a loop, you have a certain amount of iterations (repetitions). If you have a break-statement in there, the rest of the loop will be skipped and the loop is over. If you have continue there, the rest of the cutrent iteration is skipped and the next one starts. You have break-statements also in switch-blocks to end a case.
+ 2
If you are interested in learning Python then you should continue. If you're not able to understand it you can take a short break and revise basic concept of Programming then continue and you find XYZ Programming language much easier then leave Python and learn it.
0
Return will give something to the ... that called the method (or without anything behind it, doesn't it act like break? Not sure about it...)
That's how it is in Java, I think that applies to Python as well