Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
217,572 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!