Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Illustrated
  • Table Of Contents Toc
Python Illustrated

Python Illustrated

By : Maaike van Putten, Imke van Putten
close
close
Python Illustrated

Python Illustrated

By: Maaike van Putten, Imke van Putten

Overview of this book

This is not your average Python programming book, because the world doesn’t need another one of those. Instead, it’s an illustrated, fun, and hands-on guide that treats learning Python like the adventure it should be. It’s designed especially for beginners who want to understand how code works without getting overwhelmed. You’ll be guided by a cheeky, know-it-all cat who’s surprisingly good at teaching Python from scratch. Don’t worry about going through it alone; a slightly moody dachshund dog is your study buddy, learning right alongside you. Each chapter introduces a core programming concept, explains it with a playful twist, and reinforces it through human-friendly examples, analogies, and exercises. Whether you’re a software professional or someone who’s never written a single line of code, this book will help you build real Python coding skills… and even enjoy the process (shocking, right?). Forget dry tutorials and walls of text. Python Illustrated speaks to visual learners, creative thinkers, cat lovers, dog lovers, and anyone who prefers their learning with a dash of humor. From writing your first function to understanding object-oriented programming, you’ll build a solid foundation in Python (without the usual headaches).
Table of Contents (19 chapters)
close
close
Lock Free Chapter
1
Introduction
14
Other Books You May Enjoy
15
Index
1
Appendix A: Exercise Files

Nested loops

Sometimes, we need to loop inside the loop. Luckily, that’s possible; loops can be nested inside other loops. This is useful when working with multi-dimensional data, such as lists that are stored in a list.

Let’s create a simple multiplication table from 1 to 3. Here’s how we can do that with a nested loop:

for i in range(1, 4):
    for j in range(1, 4):
        product = i * j
        print(f"{i} x {j} = {product}")
    print("---")

And this is what will be output:

1 x 1 = 1
1 x 2 = 2
1 x 3 = 3
---
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
---
3 x 1 = 3
3 x 2 = 6
3 x 3 = 9
---

So there’s a lot happening here! First, the outer loop (with i) runs from 1 to 3. Next, the inner loop (j) also runs from 1 to 3. In terms of flow, it goes like this: for each i, we loop through all j. And in that inner loop, we calculate the product and print it. Then, we move on to the next i, and loop through all of j again. And that...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Illustrated
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon