## Sample Code

### Simple Selection

### Operators

day = input("Name a day that starts with the letter S\n") if day == "Saturday" or day == "Sunday": print("Correct") else: print("Wrong")

year = int(input("Input your year\n")) if year>=7 and year <=9: print("You are in KS3") else: print("You are not in KS3")

## Exercises

- Prompt the user as follows: “What’s the capital of France?” Output “Correct” if they enter “Paris”, output “Incorrect” otherwise
- Prompt the user as follows: “Name a month that starts with the letter A”: Output “Correct” if they enter “April” or “August”, output “Incorrect” otherwise
- Prompt the user as follows: “Name a Beatle”. Output “Correct” if they enter “John”, “Paul”, “George” or “Ringo”, output “Incorrect” otherwise
- Prompt the user to enter their age. If they are 18 or over output “You are old enough to vote.” Otherwise, output “You are too young to vote”
- Prompt the user to enter their age. If they are aged between 4 and 16 output “You should be at school”
- An online whisky shop charges for shipping as follows: One bottle, £5.99; two to five bottles, books £7; more than five bottles, free. Prompt the user to enter the number of bottles bought and output the shipping cost.
- An online bookshop charges shipping as follows: Orders less than £10, £2.99; orders £10 and over, free; add on £2.50 for all orders if next day delivery is selected. Prompt the user to enter the cost of the order, and then prompt for next day delivery. Output the shipping cost.

## Extension

The modulo operator (%) is very useful. It works out the remainder when one number is divided by another. So

10 % 2 = 0 (Because 10/2 = 5 remainder 0)

10 % 3 = 1 (Because 10/3 = 3 remainder 1)

Use the modulo operator to solve the following problems.

10 % 2 = 0 (Because 10/2 = 5 remainder 0)

10 % 3 = 1 (Because 10/3 = 3 remainder 1)

Use the modulo operator to solve the following problems.

- Prompt the user to enter a number. Output if the number is odd or even.
- Prompt the user to enter a humber. Output Fizz if the number is divisible by 3, otherwise just output the number
- Extend the above problem so that the computer will output Fizz if the number is divisible by 3, output Buzz if the number is divisible by 5 and otherwise just output the number.
- Now extend the above problem again so that the computer will output Fizz if the number is divisible by 3, output Buzz if the number is divisible by 5, output Fizz Buzz if the number is divisible by both 5 and 3 and otherwise just output the number.