LPTHW Exercise 10: What Was That?

Learn Python the Hard Way by Zed Shaw .: Playing with escape sequences:

>>> cars = '''self-driving cars
... armoured cars
... \t\t\t\tgetaway cars'''
>>> print("{1} {0}\n\t{2} {0}\t\t{3} {0}\n{4} {4} {3} bumper {0}\n\a" + "." * 40 + cars).format('car', 'Red', 'blue', 'green', 'really')
Red car
        blue car                green car
really really green bumper car
........................................self-driving cars
armoured cars
                                getaway cars
>>>

More • pythonprogramming