OCR J277: Python Coding Challenges

Practice writing Python code for the following scenarios. Pay attention to the marks available for each question.

Question 1: Basic Input and Arithmetic [3 marks]

A cinema charges £10 for adult tickets and £5 for child tickets. Write a Python program that:

Question 2: Selection [4 marks]

A teacher wants a program to grade a recent test out of 50. Write a Python program that:

Question 3: Iteration and Strings [4 marks]

Write a Python program that asks the user to input a single word. The program should loop through the word and count how many times the letter "a" (lowercase) appears. It should then output the final count.

Question 4: Arrays (Lists) and Aggregation [5 marks]

An array contains the following daily temperatures: temps = [12, 15, 14, 18, 11].

Write a Python program that iterates through this array to:

Question 5: Robust Validation Loop [6 marks]

A system requires a user to set a secure PIN. Write a Python program that: