4A JOKE-TELLING PROGRAM

image

This chapter’s program tells a few jokes to the user and demonstrates more advanced ways to use strings with the print() function. Most of the games in this book will have simple text for input and output. The input is typed on the keyboard by the user, and the output is the text displayed on the screen.

You’ve already learned how to display simple text output with the print() function. Now let’s take a deeper look at how strings and print() work in Python.

Sample ...

Get Invent Your Own Computer Games with Python , 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.