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 (2015) Letter Game App Review: Python Basics

Name:GoogleSearch orJonathan Sum
Name:GoogleSearch orJonathan Sum
5,039 Points

Which kind of loop runs a set number of times?

what is the answer? could some1 explain it to me? Thank you!

2 Answers

Steven Parker
Steven Parker
231,269 Points

:point_right: It's a slightly tricky question, but there are only two choices.

The trickiness is because any loop can be made to run a set number of times, but one of the two choices is a better answer because it takes parameters that make using it this way easier.

Specifically, both types take a conditional expression, but only one also takes an initialization expression and and iterating expression. I'll bet that one is the right answer. :smile:

Name:GoogleSearch orJonathan Sum
Name:GoogleSearch orJonathan Sum
5,039 Points

the question was asking is that while loop or for loop ,so which one is?

Please explain with answer!