top of page
top

## Python - Section 4 Practice Tasks

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

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

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).

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.

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.

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.

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