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.

๐Ÿ“ Edexcel students? Practise Paper 2 challenges here
☰ Browse by Topic
Difficulty:

String Manipulation

Slicing, searching, and transforming text with string methods.

Never done this before? Learn it first →

EasyString Manipulation
Book Title Length Challenge
Write a program that asks for a book title and outputs the total number of characters in it.
EasyString Manipulation
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
EasyString Manipulation
Initials Formatter Challenge
Write a program that asks for a person's first name and last name, then outputs their initials in uppercase.
EasyString Manipulation
Movie Uppercase Challenge
Create a program that prompts the user for their favorite movie and displays the title in all capital letters.
EasyString Manipulation
String Reversal
Write a program that takes a string as input and prints it in reverse order.
EasyString Manipulation
Website Lowercase Challenge
Update the program to request a website URL and show it entirely in lowercase.
MediumString Manipulation
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
MediumString Manipulation
Paragraph Mid Extractor
Write a program that prints characters from position 10 to 20 of a given paragraph.
MediumString Manipulation
Product Description Extractor
Develop a program that extracts and prints the first five characters from a given product description.
MediumString Manipulation
Recipe Ingredient Finder
Create a program that finds the position of a specified ingredient in a recipe and displays its index.
MediumString Manipulation
Sentence Word Remover Challenge
Construct a program that displays the sentence "The smart student completed the project efficiently." The user can speci
MediumString Manipulation
Tweet End Extractor
Adjust the program to display the last twelve characters of a provided tweet using negative indexing.
MediumString Manipulation
Vowel Counter
Create a program that counts the number of vowels in a given string.
HardString Manipulation
Character Frequency
Create a program that calculates the frequency of each character in a given string.
HardString Manipulation
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
HardString Manipulation
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
MediumString Manipulation
Palindrome Checker
Check whether a word reads the same forwards and backwards.
MediumString Manipulation
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.
EasyString Manipulation
Allergy Warning Check
Use in to ask whether a word is in a string, and find() to ask where it is.
EasyString Manipulation
Username Sanitiser
Clean up a username using .strip(), .lower(), and .replace().
MediumString Manipulation
Email Domain Extractor
Extract the domain from an email using .find() and string slicing.
MediumString Manipulation
Sentence Word Counter
Split a sentence into words and analyse word properties.
HardString Manipulation
Password Strength Checker
Check password strength using character type methods and iteration.
MediumString Manipulation
Initials Generator
Extract initials from a full name using .split() and indexing.
HardString Manipulation
Caesar Cipher Encoder
Encode a message using character-by-character string processing.
MediumString Manipulation
Postcode Formatter
Validate and format UK postcodes using string methods and slicing.
MediumString Manipulation
Word Reverser
Reverse a word using string slicing or character-by-character iteration.
MediumString Manipulation
Text Censor
Replace banned words in text using .replace() and .find().
HardString Manipulation
Phone Number Validator
Validate phone numbers using .isdigit(), len(), and string slicing.