Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (Retired) Putting the "Fun" Back in "Function" Shopping List Redux

Naivedya Bansal
Naivedya Bansal
5,483 Points

continue statement

is writing the continue keyword at the end of the while loop is a must?won't just dedenting to mark the end of the block suffice ?wont it move to the next iteration by default??

2 Answers

Nitin George Cherian
Nitin George Cherian
4,410 Points

Writing the continue keyword at the end of the while loop is not necessary, but adding won't harm either. It is required only if you want to go to the beginning of the loop at some point inside the loop.

Dave Patton
seal-mask
.a{fill-rule:evenodd;}techdegree
Dave Patton
Front End Web Development Techdegree Student 5,209 Points

Thank you for clearing this up Nitin. I was so confused by this is the Python Basics course. Does it break the current run and start at the top? Seems kind of crude but good maybe for exceptions.