You've finished the course. Now the doors are locked and only code will open them. Solve puzzles in Python, check your answers with check.py, collect stars.
check.py, type the puzzle ID (e.g. B1) and your answer. Every puzzle has a small example you can test your code on first. Do all of Bronze, then as much of Silver and Gold as you can. After 3 wrong answers you get a hint.Everybody finishes these. No files needed.
Mr Docherty needs caffeine to survive the afternoon. He buys 4 coffees at £2.35 each and 3 bacon rolls at £1.90 each, and pays with a £20 note.
Your task: Write a program that works out his change. Use variables for the prices and quantities.
0.75.The fire alarm goes off and the door lock only opens for the right number. The rule on the sign: add up every whole number from 1 to 300 that is a multiple of 6 or a multiple of 8.
Your task: Use a loop and MOD to build the total. (Numbers that are multiples of both are only counted once.)
60.The bell is stuck. It only rings on a number that is a multiple of 7 but not a multiple of 5. How many of the numbers from 1 to 500 make it ring?
Your task: Count them with a loop and an IF using AND.
4.The Computing corridor door is voice locked. It needs the number of vowels (a, e, i, o, u, capital or not) in this sentence: Cover teachers are heroes who never get thanked enough
Your task: Store the sentence in a variable and count the vowels with a loop. Don't count by hand!
Hello World has 3 vowels.Reading files and handling data.
Mr Docherty has found the class test scores in data/scores.txt (60 scores, one per line).
Your task: Read the file and find the highest score, the lowest score and the average (to 1 decimal place).
90-20-60.0The IT office has dumped 80 passwords into data/passwords.txt. A password is valid if it has at least 8 characters, at least one digit, at least one capital letter and no spaces.
Your task: Count how many of the 80 passwords are valid.
Tiger2024 is valid. tiger2024 (no capital), Tiger (too short, no digit) and Tiger 2024 (has a space) are not.150 lockers and their 4-digit combinations are in data/lockers.csv (lines look like L001,4821).
Your task: Count how many lockers have a combination that contains the digit 7 at least once.
2The tuck shop has written its week into data/tuckshop.csv (item, price in pence, number sold). The first line is a heading.
Your task: Which item made the most money (price × number sold)?
juiceReal problem-solving. Be prepared to think.
Mr Docherty wrote a long, rambling speech, saved in data/speech.txt. Somebody has to find its most overused word.
Your task: Find the most common word. Ignore capital letters and punctuation, and ignore any word of 3 letters or fewer.
The lion saw the other lion. Lions! → lion-2 (the and saw are too short to count, and lions is a different word from lion).An encrypted message is in data/secret.txt. It was locked by shifting every letter forward by 7 places (A→H, B→I … and it wraps round, so T→A).
Your task: Decrypt it. The passphrase is hidden in the message.
OLSSV decrypts to HELLOThe final door only opens for prime numbers.
Your task: How many prime numbers are there below 5000, and what is the largest one?
8-19data/board.txt is a 16 × 16 minesweeper board: * is a mine, . is a safe square.
Your task: Each safe square shows how many of its (up to 8) neighbours are mines. Work out the number for every safe square and give the total of all of them.
*.. ... ..*gives
6 (the middle square shows 2).