0% found this document useful (0 votes)
3 views2 pages

Python Worksheet 6 - Iteration Part 2

This document is a Python worksheet focused on iteration using while loops. It includes exercises for outputting numbers in various ranges and steps, as well as tasks for user input and summation. An extension task is also provided for responding to specific user input with a greeting.

Uploaded by

Eddie Cheung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Python Worksheet 6 - Iteration Part 2

This document is a Python worksheet focused on iteration using while loops. It includes exercises for outputting numbers in various ranges and steps, as well as tasks for user input and summation. An extension task is also provided for responding to specific user input with a greeting.

Uploaded by

Eddie Cheung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Worksheet 6: Iteration Part 2

Activity 1: Exploring the while loop


Use this as a model to do the following exercises:

This code outputs 0 to 10, followed by Finished!

1. Output numbers from 1 to 10

2. Output numbers from 10 to 20

3. Output numbers from 10 to 20 in steps of two

4. Output numbers from 100 down to 0 in steps of five


Python Worksheet 6: Iteration Part 2

Activity 2: Repeating Input with Loops


1. Ask the user to enter five floating point numbers and output their total

2. Ask the user to enter the names of 10 countries

Extension Task:
3. Extend your answer to Exercise 2 above so that it outputs “Bonjour!” if they enter “France”

You might also like