Search this site
Embedded Files
Skip to main content
Skip to navigation
How2Py
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
How2Py
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
More
Home
Basics
Answers To Challenges
More Data Types
Answers to Challenges
Drawing
Answers to Challenges
Using Events with Turtle
Answers to Challenges
Desicions
Answers to Challenges
Loops
Answers to Challenges
Functions
Answers to Challenges
Classes
Answers to Challenges
More Modules
Answers to Challenges
Debugging Code
The Try ... Except Block
How To...
Make a Text Adventure
Answers to Challenges
Do you remember the example we used for the while loop? Can you turn that into a for loop?
Create a program that asks a user for a large number. Then, create a for loop that prints the numbers from 1 to that number.
Add a break statement that exits the loop once the number is greater than or equal to 50.
Create a program that uses a while loop instead of a for loop for challenge 3.
Add a continue statement to the program you made in challenge 4. It should skip printing the numbers in between 4 and 10.
Do you remember the example we used for the while loop? Can you turn that into a for loop?
Create a program that asks a user for a large number. Then, create a for loop that prints the numbers from 1 to that number.
Add a break statement that exits the loop once the number is greater than or equal to 50.
Create a program that uses a while loop instead of a for loop for challenge 3.
Add a continue statement to the program you made in challenge 4. It should skip printing the numbers in between 4 and 10.
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse