Access to the Complete Code for All of the Book Exercises
Access the code for all the projects in Creative Coding in Python on GitHub
You are encouraged to code along as you read the book, by typing in your own code. This complete code listing is a reference and can help you see what it should look like at the end of the project.
chapter 1
CREATE YOUR OWN CHATBOTS
Using the Big Ideas from this chapter, we will get user input and then respond to the user by putting information on the screen. This will be a simple chatbot. There will be ideas in subsequent chapters that you can use to make this chatbot better.
You can change the actual text of the chatbot responses or questions to customize it.
chapter 2
CREATE YOUR OWN
ART MASTERPIECES
Using turtle graphics is a fun way to learn Python and create artwork using code.
We’ll give the virtual turtle instructions, known as functions and combine these functions to create complex art pieces.
Chapter 3
CREATE YOUR OWN
ADVENTURE GAMES
Computers can decide if a statement is true or false. Computers use this true and false value to determine which part of the algorithm (which code) must be executed. Often, we combine different conditions to create a new condition to help us make our decision. We make decisions and execute different actions based on something being true or false.
chapter 4
CREATE YOUR OWN DICE GAMES
Learn how to make your own functions, functions allows us to name a block of code and then reuse it later by using the name. When we create games, we often want to add an element of chance. Instead of deciding on an item, we want the computer to pick something at random.
Let us make a dice game in which the computer and the user take turns rolling a fixed number of dice to see who can get the highest total. Each gets one chance to roll again and can decide which of the dice rolled must be held or rerolled.
chapter 5
CREATE YOUR OWN APPS AND GAMES
Python has a standard module for creating GUI called Tkinter. Tkinter is cross-platform, which means that the Python code used to build an application can be run on any platform.
Make a classic arcade-style game with the GUI concepts.
EXPERIMENT AND EXTEND
Each chapter ends with an Experiment and Extend section that has projects related to the main project of the chapter - they use similar ideas and programming concepts. Pseudo code and hints help you make these projects. Each project can be done in multiple ways, and working on these will help reinforce learning from the chapter. Do send questions or your own unique solution for these projects to the author using the contact form
WHAT’S NEXT ?
The last chapter in the book covers what you can do next in terms of Python to continue learning and building on your skills. This includes using Python with the micro:bit and the Raspberry Pi and even using more advanced and complex libraries for machine learning and data analysis. If you are interested in exploring other coding languages or looking at more sample project ideas , check out some of the resources on the author’s personal site: