Example: bankruptcy

THE BIG BOOK OF SMALL PYTHON PROJECTS

AL SWEIGARTTHE BIG BOOK OF SMALL PY THONPROJECTS81 EASY PRACTICE PROGRAMSTHE BIG BOOK OF SMALL PYTHON PROJECTSSan FranciscoAl SweigartTHE BIG BOOK OF SMALL PYTHON PROJECTS81 Easy Practice ProgramsTHE BIG BOOK OF SMALL PYTHON PROJECTS . Copyright 2021 by Al Sweigart. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the : 978 -1-7185- 0124 -9 (print) ISBN-13: 978 -1-7185- 0125- 6 (ebook)Publisher: William Pollock Production Manager: Rachel Monaghan Production Editor: Paula Williamson Developmental Editor: Frances Saux Technical Reviewer: Sarah Kuchinsky Cover and Interior Design: Octopod Studios Cover Illustrator.

Boring Stuff with Python and Invent Your Own Computer Games with Python. His books are freely available under a Creative Commons license at his website https://inventwithpython.com. His cat Zophie loves eating nori seaweed snacks. About the Technical Reviewer Sarah Kuchinsky, MS, is a corporate trainer and consultant. She uses

Tags:

  Your, Snacks

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of THE BIG BOOK OF SMALL PYTHON PROJECTS

1 AL SWEIGARTTHE BIG BOOK OF SMALL PY THONPROJECTS81 EASY PRACTICE PROGRAMSTHE BIG BOOK OF SMALL PYTHON PROJECTSSan FranciscoAl SweigartTHE BIG BOOK OF SMALL PYTHON PROJECTS81 Easy Practice ProgramsTHE BIG BOOK OF SMALL PYTHON PROJECTS . Copyright 2021 by Al Sweigart. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the : 978 -1-7185- 0124 -9 (print) ISBN-13: 978 -1-7185- 0125- 6 (ebook)Publisher: William Pollock Production Manager: Rachel Monaghan Production Editor: Paula Williamson Developmental Editor: Frances Saux Technical Reviewer: Sarah Kuchinsky Cover and Interior Design: Octopod Studios Cover Illustrator.

2 Josh Ellingson Copyeditor: Bart Reed Compositor: Maureen Forys, Happenstance Type-O-Rama Proofreader: Scout FestaFor information on book distributors or translations, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1-415-863-9900; of Congress Control Number: 2021936413No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the information in this book is distributed on an As Is basis, without warranty.

3 While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in the AuthorAl Sweigart is a software developer, author, and Fellow of the PYTHON Software Foundation. He was previously the education director at Oakland, California s video game museum, The Museum of Art and Digital Enter-tainment. He has written several programming books, including Automate the Boring Stuff with PYTHON and Invent your Own Computer Games with PYTHON .

4 His books are freely available under a Creative Commons license at his website His cat Zophie loves eating nori seaweed the Technical ReviewerSarah Kuchinsky, MS, is a corporate trainer and consultant. She uses PYTHON for a variety of applications, including health systems modeling, game development, and task automation. Sarah is a co-founder of the North Bay PYTHON conference, tutorials chair for PyCon US, and lead organizer for PyLadies Silicon Valley. She holds degrees in Management Science & Engineering and IN DETAILI ntroduction xvProject 1, Bagels: Deduce a secret three-digit number based on clues.

5 1 Practice using 2, Birthday Paradox: Determine the probability that two people share the same birthday in groups of different sizes. 6 Use PYTHON s datetime 3, Bitmap Message: Display a message on the screen configured by a 2D bitmap image. 11 Work with multiline 4, Blackjack: A classic card game played against an AI dealer. 15 Learn about Unicode characters and code 5, Bouncing DVD Logo: Simulates the colorful bouncing DVD logo of decades past. 23 Work with coordinates and colorful 6, Caesar Cipher: A simple encryption scheme used thousands of years ago.

6 29 Convert between letters and numbers to perform math on 7, Caesar Hacker: A program to decrypt Caesar cipher messages without the encryption key. 33 Implement a brute-force cryptanalysis 8, Calendar Maker: Create calendar pages for a given year and month. 36 Use PYTHON s datetime module and the timedelta data 9, Carrot in a Box: A silly bluffing game between two players.

7 41 Create ASCII 10, Cho-Han: A gambling dice game from feudal Japan. 47 Practice using random numbers and dictionary data Contents in DetailProject 11, Clickbait Headline Generator: A humorous headline generator for your content farm. 51 Practice string manipulation and text 12, Collatz Sequence: Explore the simplest impossible conjecture in mathematics. 56 Learn about the modulus 13, Conway s Game of Life: The classic cellular automata whose simple rules produce complex emergent behavior.

8 59 Use dictionary data structures and screen 14, Countdown: A countdown timer with a seven-segment display. 63 Practice importing modules you 15, Deep Cave: A tunnel animation that descends endlessly into the earth. 66 Use string replication and simple 16, Diamonds: An algorithm for drawing diamonds of various sizes. 69 Practice your pattern recognition skills to create drawing 17, Dice Math: A visual dice-rolling math game.

9 73 Use dictionary data structures for screen 18, Dice Roller: A tool for reading Dungeons & Dragons dice notation to generate random numbers. 79 Parse text to identify key 19, Digital Clock: A clock with a calculator-like display. 83 Generate numbers that match information from the datetime 20, Digital Stream: A scrolling screensaver that resembles The Matrix. 86 Experiment with different animation 21, DNA Visualization: An endless ASCII-art double helix that demonstrates the structure of DNA.

10 90 Work with string templates and randomly generated 22, Ducklings: Mix and match strings to create a variety of ASCII-art ducks. 94 Use object-oriented programming to create a data model for duck in Detail ixProject 23, Etching Drawer: Move the cursor to create line drawings. 100 Work with screen coordinates and relative directional 24, Factor Finder: Find all the multiplicative factors of a number. 106 Use the modulus operator and PYTHON s math 25, Fast Draw: Test your reflexes to see if you re the fastest keyboard in the West.