Knowledge organisersDesigning, creating and refining algorithms
Complete, write or refine an algorithm
In addition to pseudocode and flowcharts, you should be able to write and work with algorithms using a high-level programming language such as Python or the OCR Exam Reference Language. This means being able to write complete programs, fix bugs in existing code, and refine algorithms to improve their efficiency or correctness.
# Validated input in Python
age = int(input("Enter your age (0-120): "))
while age < 0 or age > 120:
print("Invalid age, try again.")
age = int(input("Enter your age (0-120): "))
print("Your age is " + str(age))