This Python practice set contains simple coding exercises for beginners. These exercises will help you practice code organization skills such as handling variables, structuring program flow with if statements and for loops, and writing functions. You’ll work with many string functions and text files and practice various iteration techniques over strings, lists, and dictionaries.
This course is organized into three fun thematic sections, each related to working with words and strings in Python. In the first section, you’ll implement a simple cipher in Python and use it to code and decode words. In the second section, you’ll analyze the text of one of the Sherlock Holmes novels, “The Hound of the Baskervilles” by Arthur Conan Doyle. Finally, in the last section, you'll implement functions helpful in playing the game Scrabble.
Here is what you’ll practice in each section:
- Cipher: You’ll learn about Unicode and how to convert characters in a string to their Unicode number and the other way around. After this section, you’ll know how to implement the Caesar cipher, one of the oldest ciphers that exist. To finish this section, you’ll have to crack the code encrypted with Caesar's cipher.
- Sherlock Holmes: You’ll analyze the text of a novel, “The Hound of the Baskervilles.” You’ll read in the contents of a text file, find out how many unique words there are, count how many times a given character occurs, and finally, check for playful word concepts such as palindromes and semordnilaps.
- Scrabble: You’ll implement functions that can help you in playing this popular word game. You’ll learn how to list all possible words you can create from given letter tiles, calculate the value of a word, and find words with the greatest number of points.
You can of course do the exercises in any order. However, we recommend completing them as we have arranged them in the course. This way you will have the most fun and learn the most.
This Python practice course is designed for people who have just started with programming and are having trouble finding suitable coding exercises online. We assume that you have learned the basics of Python syntax from our Python Basics series (Python Basics. Part 1, Python Basics. Part 2, Python Basics. Part 3) or have the equivalent knowledge.
You should already know about variables, if statements, for and while loops, basic Python data structures (lists, dictionaries, and sets), how to work with strings, and how to read and write into a file. Ideally, you don’t have much practical experience with programming and would like to practice your coding skills.
This course is interactive. You’ll practice by writing real Python programs and solving exercises in your web browser. Our web-based platform will run your command and verify your solution. You don’t need to install anything on your computer.