Python loops-ல் execution flow-ஐ control செய்ய break மற……
break and continue in Python
break break statement is used to immediately terminate the entire loop. தமிழில்: Loop நடந்து கொண்டிருக்கும்போது ஒரு particular condition வந்ததும் முழு loop-ஐ உடனே நிறுத்த break பயன்படும். continue continue statement skips the current itera…
break break statement is used to immediately terminate the entire loop. தமிழில்: Loop நடந்து கொண்டிருக்கும்போ……
இதுதான் main difference: break ↓ Entire Loop STOP continue ……
break Flow Loop Start ↓ Condition Check ↓ break condition True? ↙ ↘ Yes No ↓ ↓ Loop Stop Continue Loop ……
1. break with for Loop…
for i in range(1, 6): if i ==……
for i in range(1, 6): Values: 1, 2, 3, 4, 5 First: i = 1 Condition: i == 3 False. So: print(i) ……
i = 1 1 == 3 → False Print 1 i = 2 2 ……
இந்த program: for i in range(1, 6): if i == 3: break ……
Compare: for i in range(1, 6)……
இங்கே print(i) first. அதனால் ……
Code order matters.…
i = 1 while i…
Loop completely stops.…
Suppose password search: passwords = ["123", "abc", "Tesla36……
Once required value found, rema……
1. continue with for Loop…
for i in range(1, 6): if i ==……
Values: 1, 2, 3, 4, 5 When: i = 1 condition False → print 1. When: i = 2 condition False → pr……
i = 1 1 == 3 → False Print 1 i = 2 2 == 3 → False Print ……
Same condition பயன்படுத்திப் பார்ப்போம்……
Sequence: 1 2 3 4 5 break at ……
Imagine school class. break Teacher says: "Class over!" Everybody stops. continue Teac……
continue + while கொஞ்சம் careful-ஆக பயன்படுத்த வேண……
continue with while can creat……
Update value before continue possibil……
With while + continue: Ensure the loop-control v……
Nested loop: for i in range(1, 4)……
Outer loop: i = 1 Inner: j = ……
break stops only the nearest / innerm……
Nested loops-ல்: break all loops-ஐ ……
for i in range(1, 3): for j i……
மட்டும் skip ஆகிறது.…
List-ல் number search: numbers = [10, 20……
numbers = [10, 20, 30, 30, 50……
Because loop continues checki……
numbers = [10, 20, 30, 30, 50] ……
First match கிடைத்ததும் stop.…
Suppose marks: marks = [80, -1, 75, 90] -1 invalid m……
Invalid value மட்டும் skip.…
for i in range(1, 11): if i %……
Even numbers வந்தால்: continue அ……
for i in range(1, 11): if i %……
Odd numbers skip செய்யப்படுகி……
Python-ல் for...else உள்ளது. for……
for i in range(1, 5): if i ==……
Completed வராது. Why? Loop br……
for i in range(1, 5): if i ==……
Why? continue entire loop-ஐ terminate ……
for i in range(3): pass print……
pass doesn't skip print.…
So: pass ≠ continue pass → nothing ……
break outside loop Wrong: if x == 10: break If th……
continue outside loop Wrong: if x == 5: con……
Thinking break exits program break does not n……
Loop ended. Program continues……
Thinking continue restarts program No. c……
Confusing continue with break break = ……
B = Break = Bye Loop BREAK ↓ BYE ↓ Loop Finished ……
1. break is used to?…
Terminate a loop immediately.…
1. continue is used to?…
Skip current iteration.…
1. Can break be used in for?…
Yes.…
1. Can break be used in while?…
Yes.…
1. Can continue be used in bo……
Yes.…
1. break in nested loop termi……
Innermost loop.…
1. continue terminates entire……
No.…
1. break terminates whole pro……
No. It terminates the corresp……
1. Which may prevent a loop's……
break…
1. Which moves execution to n……
continue…
Question: Difference between break and continue? break: exits the complete loop immediately. continue: skips ……
Which statement immediately t……
Which statement skips the cur……
1 3 4 1. break in nested loop……
Which statement may lead to i……
Can break occur outside a loo……
Does continue terminate the l……
2 3 1. Which statement does n……
continue transfers control to:…
Stop at 5 for i in range(1, 1……
Skip 5 for i in range(1, 10):……
Skip even numbers for i in ra……
Stop when number reaches 6 i ……
Skip number 3 in while i = 0 ……
Python loop control: Loop Control Statements │ ├── break │ ↓ │ Entire Loop Stop │ ├── conti……
break = Loop விட்டே வெளியே போ. cont……
break மற்றும் continue Python-ன் loop control statements. break ஒரு for அல்லது while loop-ஐ முழுவ……