[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –

Python Programming Tutorial – 11 – Continue
by
Tags:
Comments
26 responses to “Python Programming Tutorial – 11 – Continue”
-
if the print(n) is right under continue it wont print anything,when moving it tab backward its good,and when another tag backward,it prints 19
explanation? -
10 dislikes for US beating Russian's!
-
kind of a dumb name for this keyword. skip would have been better. Just saying.
-
I put "break" in instead of "continue" for fun and I got what I expected in the output, 1
numbers_taken = {2, 6, 12, 34, 22, 13}
for n in range(1, 100):
if n in numbers_taken:
break
print (n)
However, when I moved the print command back one indent I get 2. why?
numbers_taken = {2, 6, 12, 34, 22, 13}
for n in range(1, 100):
if n in numbers_taken:
break
print (n) -
Nice work Bucky. If i will like to the numbers divisible by four, using the same example what will i do?
print("Here are the numbers that are divisible by 4")
for n in range(1, 21):
if n%4 is 0:
continue
print(n)
the outcome is a list of numbers not visible by 4. -
Any IDEA why this Program doesn't print n values:
———————————————————————————-
JerseyNumbersTaken = [12, 17, 21, 25, 29]
print("HERE ARE THE JERSEY NUMBERS STILL AVAILABLE TO TAKE. ")
for n in range(1, 30):
if n in JerseyNumbersTaken:
continue
print(n)
———————————
output:HERE ARE THE JERSEY NUMBERS STILL AVAILABLE TO TAKE.
Process finished with exit code 0
————————– -
wow i was wondering why i cant do homework, but the problem was in "="
for x in range(1,101):
if x % 4 = 0:
print(x)
This doesnt work.. but it works with
if x % 4 IS 0:omg
-
for n in range(101):
if n % 4 is 0:
print(n)My first try homework, 2nd try edited removed 0 from it by range(1,101)
found another method by Increment by 4 reducing 1 line of code but the problem is 0 also gets involved.
for n in range(0,101,4):
print(n) -
continue is go on the loop and ignore the rest, but break is jumping out
-
for n in range(1,101):
if n % 4 is 0:
print(n) -
Made the mistake of typing: if n is numbersTaken: instead of: if n in numbersTaken:
It is useful to distinguish between the two different uses:
for n in range(1,20):
if n in numbersTaken[:]:
continue
print(n)print('n')
for n in range(1,20):
for p in range(0,len(numbersTaken)):
if n is numbersTaken[p]:
print(n) -
zoom in your screen or teach us how to get the font larger. It is kind of not seen clearly what you type out there
-
great Tutorial bro…u are the best ILU Bucky
-
for x in range (101):
if x%4 is 0:
print (x, " can be divided by 4 exactly.") -
always give us some assignments like you did in the previous one
-
what is difference between 'is' and 'in'??
-
for n in range(101):
if n%4 is 0:
print("you are done it is ", n)
break
else:
print("Go on") -
This program 11 not working with me , help 🙁
-
Please help me, i cant re-install pycharm. its saying "NO PYTHON INTERPRETER SELECTED" Please help me….
-
Dude Thanks!
-
for i in range(0, 101):
if i % 4 is not 0:
continue
print(i) -
numbersTaken = [2, 5, 15, 12, 19]
print("Here are the remaining numbers:")
for n in range(1, 20):
if n in numbersTaken:
continue
print(n, sep='', end=', ') -
i had to wath this tut 5 times to clik the trick behind the continue thing….
-
when i am running the same code it is showing all the number
-
i dont understand the in part when typing for n in range……
-
Awesome dude thxx a lot
Leave a Reply