top of page
top

Python - Section 4 Practice Tasks

noun-decision-3428301-FFFFFF.png

Task One: Spanish Numbers

Create a very simple Spanish translation program.

Let the user enter a number between one and four then print the Spanish word for that number using if, three elifs and else.

One in Spanish is uno, two is dos, three is tres and four is cuatro.

If they enter anything else print “I only know 1 to 4 in Spanish!”.

Example solutions:

Enter a number between 1 and 4: 3
tres

noun-spain-1958167-FFFFFF.png

Enter a number between 1 and 4: 5
I only know 1 to 4 in Spanish!

Task Two: School Trip

A school is organising a trip to Alton Towers. The coaches they are hiring can fit 45 people.

Enter the total number of people going on the trip and work out how many coaches will be full (using integer division) and how many people will be left over on a partly full coach (using modulo division).

noun-bus-4690998-FFFFFF.png

Example solutions:

How many people are going on the trip? 100
There will be 2 full coaches and 10 people on another coach.

How many people are going on the trip? 212
There will be 4 full coaches and 32 people on another coach.

Task Three: Driving Tractors

There are different rules in the United Kingdom for what farmers at certain ages can drive. Ask the user to input their age and then output the relevant information below:

  • Children under 13 cannot drive any tractors.

  • A trained and supervised 13 to 15 year old can drive a low-powered tractor on private flat grass.

  • 16 year olds with a provisional category F licence can drive tractors less than 2.45 metres wide.

  • Young adults from 17 to 20 with the correct licence and training can drive tracked vehicles that weigh less than 3,500kg.

  • Adults over 21 years old, with the correct licence and training, can drive all types of tractor.

Note: Always be safe around machinery in farms regardless of your age. Driving without adequate training and a licence is illegal.

noun-tractor-4930893-FFFFFF.png

Example solutions:

How old are you? 8
You cannot drive any type of tractor.

How old are you? 13
If you are trained and supervised you can drive a low-powered tractor on private flat grass.

How old are you? 19
With the correct licence and training you can drive tracked vehicles that weigh less than 3,500kg.

Task Four: Avoid the Three

Choose a category like planets, people in your class or months of the year. Secretly choose three of them.

Ask the user to enter a word in your category. If they enter one of the three that you chose, they lose.

noun-avoid-4934376-FFFFFF.png

Example solutions:

I have secretly selected three months you must avoid!
Enter a month of the year:
April
AHA! You chose one of the secret months, you lose!

I have secretly selected three months you must avoid!
Enter a month of the year:
December
Well done, you didn't choose one of my three!

bottom of page