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

Iteration Main Activity

The document outlines a programming exercise involving Python, specifically focusing on loops. It provides examples of tasks that require the use of For Loops and While Loops to output numbers and create times tables based on user input. The document also includes instructions for taking screenshots of the completed programs.

Uploaded by

Janika Frimpong
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)
7 views2 pages

Iteration Main Activity

The document outlines a programming exercise involving Python, specifically focusing on loops. It provides examples of tasks that require the use of For Loops and While Loops to output numbers and create times tables based on user input. The document also includes instructions for taking screenshots of the completed programs.

Uploaded by

Janika Frimpong
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
You are on page 1/ 2

Iteration Main Activity

FOR LOOP Example:

Write a program that:

• outputs all numbers between 1 and 10

Answer:

x=1

while x < 11:

print(x)

x=x+1

Task 1

Open python, idle, click on file, new window to write the following python programs:

Q1. Write a program that:

• outputs all odd numbers between


1 and 99

Tip: You must use a For Loop for this challenge.

Show screenshot below of your program:

Q2. Write a program that:

• asks the user to input a number

• outputs the times table for that number

Tip: You must use a For Loop for this challenge.

Show screenshot below of your program:


Q3. Write a program that:

• asks the user to input a number

• outputs the times table for that number

• starts again every time it finishes

Tip: You must use a For Loop and a While Loop for this challenge.

Show screenshot below of your program:

Q4. Write a program that:

• asks the user to input a number and repeats until they guess the number 7

• congratulate the user with a ‘Well Done’ message when they guess correctly

Show screenshot below of your program:

You might also like