Mission Python by Sean McManus
Author:Sean McManus
Language: eng
Format: epub
Publisher: No Starch Press
Published: 2018-11-01T16:00:00+00:00
➍ add(5, 7)
add(2012, 137)
add(1234, 4321)
Listing 8-1: Sending information to a function
Save the program as listing8-1.py. Because it doesn’t use any Pygame Zero features, you can run it by clicking Run ▸ Run Module or by pressing F5. (If you do run it using Pygame Zero, the results will appear in the command line window, and the game window will be empty.)
When you run the program, you should see the following output:
5 + 7 = 12
2012 + 137 = 2149
1234 + 4321 = 5555
We create a new function called add() ➊. After we’ve defined add(), we can run it by using its name ➍ and send it numbers by putting them in the parentheses, using commas between them ➍. The function will then add those two numbers.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Code Book by Simon Singh(2768)
The Checklist Manifesto by Atul Gawande(2577)
Everything, Everything by Nicola Yoon(2513)
Tales of the Unexpected by Roald Dahl(2253)
If It Bleeds by Stephen King;(2230)
One Fish Two Fish Red Fish Blue Fish by Dr Seuss(2220)
Easy Electronics by Charles Platt(2160)
The Astronomy Book by DK(2009)
We're All Wonders by R. J. Palacio(1986)
Science Experiments You Can Eat by Vicki Cobb(1684)
Fashion 101 by Erika Stalder(1678)
Minecraft by Mojang Ab(1622)
The Art of Flight by unknow(1603)
Weather by Jenny Offill(1599)
Martin Gardner's Science Magic by Martin Gardner(1567)
Romancing the Nerd by Leah Rae Miller(1552)
The Boy, The Mole, The Fox and The Horse by Mackesy Charlie(1539)
Obsession (The Volkov Mafia Series Book 1) by S.E Foster(1461)
How To Read A Book- A Classic Guide to Intelligent Reading by Mortimer J. Adler Charles Van Doren(1446)
