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

Python Programming Worksheet

The document contains a Python programming worksheet with various tasks for users to complete. It includes instructions for creating programs that count digits in a number, calculate factorials, determine restaurant bill discounts, set ticket prices based on age, generate multiplication tables, and display numbers in descending order. Each task specifies user input requirements and expected outputs.

Uploaded by

menciajama1996
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)
39 views2 pages

Python Programming Worksheet

The document contains a Python programming worksheet with various tasks for users to complete. It includes instructions for creating programs that count digits in a number, calculate factorials, determine restaurant bill discounts, set ticket prices based on age, generate multiplication tables, and display numbers in descending order. Each task specifies user input requirements and expected outputs.

Uploaded by

menciajama1996
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

Python Programming Worksheet-

Revision
Instructions:
Read the question below carefully and write the correct Python program to solve
the problem.

Questions:
Group 4-5

1. Create a Python program that asks the user for a number and counts how
many digits it has.

Requirements:

 Ask the user for a number.

 Use a loop to count the number of digits.

 Display the count.

2. Create a Python program that calculates the factorial of a number using a loop.

Requirements:

 Ask the user for a number.

 Use a loop to calculate the factorial (n! = n × (n-1) × (n-2) × ... × 1).

 Display the result.

3. Create a Python program that calculates the discount on a restaurant bill


based on the total amount spent.
 Above R100: 20% discount
 Between R50 - R100: 10% discount
 Below R50: No discount

Group 6

1. Create a Python program that determines a person’s ticket price based


on their age.
 Children (0 - 12 years): R5

 Teenagers (13 - 17 years): R8

 Adults (18 - 64 years): R12

 Seniors (65+ years): R7

The program should ask the user for their age and display the ticket price.

2. Create a Python program that generates the multiplication table for a


number provided by the user.
 Ask the user for a number.
 Use a loop to print the multiplication table from 1 to 12.
 Display each multiplication result.

3. Create a Python program that asks the user for a number and displays
all numbers from that number down to 1.
 Ask the user for a number.
 Use a loop to print numbers in descending order.

You might also like