Python projects for beginners
Complete programs to run in your browser, read part by part, and make your own.
Games
Console games to play, then make your own.
- Number guessing gameThe computer picks a secret number from 1 to 100, and you have seven tries to find it with a hint after every guess.Beginner · about 30 min · random.randint, while and for loops
- Rock paper scissorsYou play rock, paper, scissors against the computer, round by round, until one of you has won three rounds.Beginner · about 30 min · dictionaries, random.choice
- HangmanThe computer hides a word, and you guess it one letter at a time while a stick figure appears on the gallows with every wrong letter.Beginner · about 45 min · lists and sets, multi-line strings
- Tic-tac-toeTwo players take turns on one keyboard, or you play X against a computer that takes winning squares and blocks yours.Intermediate · about 75 min · lists, tuples of winning lines
- Dice rolling simulatorIt rolls up to five dice and draws their faces, or rolls thousands of times and shows how often each total comes up.Beginner · about 40 min · random.randint, dictionaries for counting
- Quiz gameIt asks five multiple-choice questions about Python, picked at random from a bank of ten, and gives your score at the end.Beginner · about 40 min · lists of dictionaries, random.sample and random.shuffle
- BlackjackYou bet chips, take cards or stand, and try to finish closer to 21 than the dealer without going over.Intermediate · about 90 min · lists of tuples, list comprehensions
- Word guessing gameYou have six tries to find a secret five-letter word, and every guess shows which letters are in the right spot, elsewhere in the word or not in it.Intermediate · about 60 min · string indexing, lists and sets
- Text adventure gameYou wake up in a locked house and type commands such as go north and take lamp to explore the rooms and find a way out.Intermediate · about 90 min · nested dictionaries, parsing commands with split
- Word story gameIt asks you for words such as an adjective, an animal and a number without showing the story, then prints the story with your words in it.Beginner · about 30 min · str.format with named fields, lists of tuples
- Higher or lowerA card is turned over from a shuffled deck, and you guess whether the next one is higher or lower to build the longest streak you can.Beginner · about 40 min · lists of tuples, random.shuffle
- Four in a rowTwo players take turns dropping X and O pieces into a 6 by 7 grid, and the first to line up four across, down or diagonally wins.Intermediate · about 90 min · lists of lists, nested loops
- Typing speed testType three sentences as fast as you can and see your speed in words per minute, your accuracy and the words you got wrong.Intermediate · about 45 min · time.perf_counter, difflib.SequenceMatcher
- Multiplication quizPick the times tables to practise and answer timed questions, then see your score, your time and the facts you missed.Beginner · about 40 min · random.choice and random.randint, time.perf_counter
- MinesweeperOpen squares by typing their coordinates, flag the mines you find and clear the board without stepping on one.Intermediate · about 90 min · sets, dictionaries
Useful tools
Programs that do a job: calculators, trackers, managers.
- CalculatorPick an operation from a menu, type two numbers and get the answer, with every result kept in a history you can look back at.Beginner · about 40 min · functions, dictionaries
- To-do listAdd tasks, tick them off as you finish them and find them again next time, because the list is saved in a text file.Beginner · about 45 min · file handling, lists of dictionaries
- Password generatorChoose a length and the kinds of characters to use, and get random passwords with a note on how strong they are.Beginner · about 35 min · secrets module, string constants
- Unit converterConvert lengths, weights and temperatures between metric and imperial units from a short menu.Beginner · about 40 min · dictionaries of factors, functions
- BMI calculatorEnter a weight and height in metric or imperial units and get the BMI, its category and the healthy weight range for that height.Beginner · about 30 min · functions that return tuples, input checks
- Expense trackerRecord what you spend with a date, a category and a note, then see where the money went in a table of totals by category.Intermediate · about 60 min · csv module, datetime dates
- Contact bookStore names, phone numbers and email addresses, then find, change or remove any contact by searching for part of it.Intermediate · about 60 min · classes and methods, lists of objects
- ATM machineSign in with a PIN, then check the balance, deposit money, withdraw cash and print a mini statement, as at a real cash machine.Intermediate · about 45 min · classes and methods, loops with a counter
- Student grade managerEnter each student's marks in five subjects and get a ranked report table, a grade for every subject and a report card for any student.Intermediate · about 60 min · dictionaries, lists of tuples
- Library management systemKeep track of books and members, issue a book with a due date and work out the fine when it comes back late.Intermediate · about 75 min · classes and objects, dictionaries
- Age calculatorType a date of birth and get the exact age in years, months and days on any date, with the weekday of birth and the next birthday.Intermediate · about 45 min · datetime and strptime, calendar.monthrange
- Currency converterConvert an amount between common currencies such as US dollars, euros and rupees, using a table of example rates.Beginner · about 30 min · dictionaries of tuples, functions
Text and words
Ciphers, translators and text tools.
- Caesar cipherEncrypt a message by shifting its letters, decrypt it again, or crack a secret message without the key by trying every shift.Beginner · about 40 min · ord() and chr(), % for wrapping around
- Morse code translatorType a sentence to see it in dots and dashes, or paste Morse code to read it as text.Beginner · about 30 min · dictionaries, dictionary comprehensions
- Text analyzerPaste a paragraph and get its word count, sentence count, longest word, most used words and reading time.Beginner · about 45 min · re.findall and re.split, collections.Counter
- Pig Latin translatorType an English sentence and get it back in Pig Latin, with capitals and punctuation kept where they were.Beginner · about 30 min · string slicing, enumerate()
- Acronym generatorType a phrase and get its acronym, with dots and without small words, plus a guess at whether people say it as a word or as letters.Beginner · about 25 min · list comprehensions, zip()
- Number to wordsType a whole number and see it written out in words, in millions and thousands and, for big numbers, in lakh and crore too.Beginner · about 45 min · divmod(), lists as lookup tables
Logic and puzzles
Solvers and simulations that think for themselves.
- Sudoku solverType a Sudoku puzzle row by row, or use the built-in one, and the program fills in every empty cell.Intermediate · about 60 min · recursion, backtracking
- Maze solverSolve the example maze or a new random one and see the shortest path from S to E drawn in dots.Intermediate · about 60 min · breadth-first search, collections.deque
- Game of LifeChoose a starting pattern and a number of generations, then watch the cells live, die and travel across the grid.Intermediate · about 45 min · sets of tuples, collections.Counter
More to build
Games with graphics
Pygame games that play in the browser, with their full code.
Drawings
Turtle programs that draw flags, spirals, fractals and festive scenes.
Data projects
Step-by-step lessons that analyse and clean real-looking data.
Shorter programs for practice, including the CBSE class 11 and 12 practical lists, are in Python programs.