GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing inventwithpython.com — Gullible BUY THIS BOOK: No Starch Press (free ebook) | Amazon | Barnes and Noble | Powell's | Bookshop.org | Goodreads | Kobo | Thriftbooks
SUPPORT THE AUTHOR: Patreon or Donate Directly
Prev: Guess the Number | Next: Hacking Minigame
In this short and simple program, you can learn the secret and subtle art of keeping a gullible person busy for hours. I won’t spoil the punch line here. Copy the code and run it for yourself. This project is great for beginners, whether you’re smart or . . . not so smart. The Program in ActionWhen you run gullible.py, the output will look like this:
How It WorksTo be more user friendly, your programs should attempt to interpret a range of possible inputs from the user. For example, this program asks the user a yes/no question, but it would be simpler for the player to simply enter “y” or “n” instead of enter the full word. The program can also understand the player’s intent if their caps lock key is activated, because it calls the
Exploring the ProgramTry to find the answers to the following questions. Experiment with some modifications to the code and rerun the program to see what effect the changes have.
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |