[Tutor] Potential problem with Game Over 2.0 problem in "Python Programming for the Absolute Beginner, 3rd Ed."

boB Stepp robertvstepp at gmail.com
Tue Feb 17 18:57:03 CET 2015


I know that there have been multiple posts in the past about Michael
Dawson's book, "Python Programming for the Absolute Beginner, 3rd
ed.". Because of this I thought I might mention something my son
encountered this morning. I have finally gotten my son to start
working in this book. He came to me with a problem this morning, which
he could not figure out when trying to replicate the author's (Michael
Dawson) Game Over 2.0 program in chapter two on page 17. The object of
this program is to do ASCII-style art to generate a large rendition of
"Game Over" using the following characters: "_" , "\" , "|" , and "/"
. When my son tried to do his version, the "Over" portion did not
print correctly. The top half of "Over" printed first followed by the
second half of the word next to it. I don't want to say too much for
those working through this book, but the essence of the issue is
illustrated by the following:

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600
64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print(
"""
boB
Stepp
"""
)

boB
Stepp

>>> print(
"""
boB\
Stepp
"""
)

boBStepp

This led to a discussion with my son about the invisible characters
that terminate lines in Window and *nix, escape sequences, etc.
Hopefully this might prove helpful to those starting this book without
just giving the answer if this problem comes up in their efforts.

-- 
boB


More information about the Tutor mailing list