Breaking out of loops

Sherry W writes (excerpted):

Excellent book so far for my grandson.

On page 78 should it read?:

while True:
    lots of code here
    lots of code here
    lots of code here
    if some value == False
        break

Book is written very well for that age group. It’s great to h...

Continue reading...
Problem with bouncing ball

Problem with bouncing ball

Lennier M writes:

I am on page 202 of your book, but when I followed your instructions, the ball stopped moving, instead of moving in multiple directions. Here is my code:

class Ball:
    def __init__(self, canvas, color):
        self.canvas = canvas
        self.id = canvas.create_oval(...

Continue reading...
Long and short dashes

Long and short dashes

Jan vK writes:

here’s an example from your book that gives an error: count_down_by_twos = list(range(40, 10, −2)) SyntaxError: invalid character in identifier please inform me how to solve this problem

It looks like you might have copied-and-pasted the code? Perhaps from the digital version...

Continue reading...

IDLE3 on Ubuntu

Chris K writes (excerpted):

I'm teaching myself and home educating my three young daughters at the same time. Just a little bit every day (excepting Sunday which is entirely reserved for pancakes and not inter-computery-things) . Thank you for providing the opportunity for me to introduce the ...

Continue reading...

String Formatting

Lou O writes:

Hi Jason, Read a few good reviews of your book on Amazon. One of the reviews pointed out “The explanation of String formatting needs to be updated. We don’t do embedded values using %s anymore. I recommend skipping the chapters on Turtle Graphics and tkinter. The introductory...

Continue reading...

Bouncing in Polski

Marzena writes:

I’m writing to you because neither me nor my 11-year old daughter with whom we’re learning Python can figure out where the problem is. We get the following error:
 ================ RESTART: C:/Users/Enarpol/Desktop/brajan.py ================
 Traceback (most recent call last):
...

Continue reading...