Python Programming Challenges
292 free challenges for GCSE Computer Science students. Perfect for OCR and AQA students looking to practise Python programming, or anyone who wants to sharpen their coding skills.
☰ Browse by Topic
String Manipulation
Slicing, searching, and transforming text with string methods.
Book Title Length Challenge
Write a program that asks for a book title and outputs the total number of characters in it.
Country Shortener Challenge
Create a program where the user inputs the names of two countries. The program will output the first four letters of eac
Initials Formatter Challenge
Write a program that asks for a person's first name and last name, then outputs their initials in uppercase.
Movie Uppercase Challenge
Create a program that prompts the user for their favorite movie and displays the title in all capital letters.
String Reversal
Write a program that takes a string as input and prints it in reverse order.
Website Lowercase Challenge
Update the program to request a website URL and show it entirely in lowercase.
City Code Generator
Write a program that allows the user to input the names of two cities. The program should then output the first 3 charac
Paragraph Mid Extractor
Write a program that prints characters from position 10 to 20 of a given paragraph.
Product Description Extractor
Develop a program that extracts and prints the first five characters from a given product description.
Recipe Ingredient Finder
Create a program that finds the position of a specified ingredient in a recipe and displays its index.
Sentence Word Remover Challenge
Construct a program that displays the sentence "The smart student completed the project efficiently." The user can speci
Tweet End Extractor
Adjust the program to display the last twelve characters of a provided tweet using negative indexing.
Vowel Counter
Create a program that counts the number of vowels in a given string.
Character Frequency
Create a program that calculates the frequency of each character in a given string.
Name Splitter Challenge
Write a program that allows the user to enter their full name on one line. The program should then separate and output t
Sentence Word Remover
Write a program that outputs a sentence and allows the user to enter a word to be removed. The sentence is then displaye
Palindrome Checker
Check whether a word reads the same forwards and backwards.
Text Message Splitter
Use len() to work out how many 160 character texts a message will need and how much room is left in the last one.
Allergy Warning Check
Use in to ask whether a word is in a string, and find() to ask where it is.
Username Sanitiser
Clean up a username using .strip(), .lower(), and .replace().
Email Domain Extractor
Extract the domain from an email using .find() and string slicing.
Sentence Word Counter
Split a sentence into words and analyse word properties.
Password Strength Checker
Check password strength using character type methods and iteration.
Initials Generator
Extract initials from a full name using .split() and indexing.
Caesar Cipher Encoder
Encode a message using character-by-character string processing.
Postcode Formatter
Validate and format UK postcodes using string methods and slicing.
Word Reverser
Reverse a word using string slicing or character-by-character iteration.
Text Censor
Replace banned words in text using .replace() and .find().
Phone Number Validator
Validate phone numbers using .isdigit(), len(), and string slicing.