𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Python 3 Pocket Primer

✍ Scribed by Parker, James R


Publisher
Mercury Learning & Information
Year
2017
Tongue
English
Leaves
180
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


This book is an effort to give programmers sufficient knowledge of Python 3 to be able to work on their own projects. Although it covers all of the basic concepts, the book features a chapter onPyGame, which allows a programmer to handle graphics, mouse and keyboard interaction, and play sounds and videos. The demonstration example for that chapter is aLunar Landergame. Another feature is the chapter on communication, which makes use of one of Python's best features: a collection of modules for sending and receiving Email, communicating between computers, and working withTwitterand Web pages. Companion files that accompany this book contain all of the code examples as complete working programs. This means that there is no need to key them in, so they can be executed and perhaps modified or expanded.

Features:

-Features a chapter on PyGame, which allows a programmer to handle graphics, mouse / keyboard interaction, and play sounds and videos
-Explores communication in depth, making use of one of Python's best features: a collection of modules for sending and receiving Email, communicating between computers, and working withTwitterand Web pages.
-Companion files contain all of the code examples as complete working programs

✦ Table of Contents


Title Page......Page 4
Copyright......Page 5
Contents......Page 6
Preface......Page 10
Executing Python......Page 12
Rock-Paper-Scissors......Page 13
Variables and Values – Experimenting with the Graphical User Interface......Page 14
Exchanging Information with the Computer......Page 16
Strings, Integers, and Real Numbers......Page 17
Example 2: Compute the Circumference of Any Circle (Input)......Page 18
IF Statements......Page 19
Documentation......Page 22
Rock-Paper-Scissors Again......Page 24
Types Are Dynamic......Page 26
The WHILE Statement......Page 28
Modules and Random Numbers......Page 30
Counting Loops......Page 31
Prime or Non-Prime......Page 33
Exiting from a Loop......Page 35
Exceptions and Errors......Page 36
Strings......Page 40
Comparing Strings......Page 41
Slicing – Extracting Parts of Strings......Page 42
Problem: Identify a β€œprint” Statement in a String......Page 43
Problem: Change the Suffix of a File Name......Page 44
Problem: Is a Given File Name That of a Python Program?......Page 45
String Methods......Page 46
For Loops Using Strings......Page 47
Tuples......Page 48
Tuples in For Loops......Page 49
Problem: Print the Number of Neutrons in an Atomic Nucleus......Page 50
Problem: What Even Numbers Less than or Equal to 100 Are Also Perfect Squares?......Page 51
Problem: Delete the Element Lithium from the Tuple atoms, along with Its Atomic Number......Page 52
Tuple Assignment......Page 53
Lists......Page 55
Problem: Compute the Average (Mean) of a List of Numbers......Page 56
Insert......Page 57
Extend......Page 58
Sort......Page 59
Reverse......Page 60
List Comprehension......Page 61
Lists and Tuples......Page 62
Problem: Delete a Specified Element from a List......Page 63
Set Types......Page 64
Example: Craps......Page 65
Chapter 4: Functions......Page 68
Function Execution......Page 69
Problem: Write a Function to Calculate the Square Root of Its Parameter.......Page 71
Parameters......Page 72
Default Parameters......Page 74
Example: The Game of Sticks......Page 76
Scope......Page 78
Variable Parameter Lists......Page 79
Variables as Functions......Page 81
Example: Find the Maximum Value of a Function......Page 82
Functions as Return Values......Page 84
Recursion......Page 85
Creating a Python Module......Page 86
Chapter 5: Files: Input and Output......Page 88
Problem: Read a Number from the Keyboard and Divide It by 2......Page 89
Open a File......Page 90
File Not Found Exceptions......Page 91
Reading from Files......Page 92
End of File......Page 93
CSV Files......Page 94
Problem: Print the Names of Planets Having Fewer than Ten Moons......Page 95
The With Statement......Page 96
Example: Write a Table of Squares to a File......Page 97
Example: Append Another 20 Squares to the Table of Squares File......Page 99
Chapter 6: Classes......Page 100
The Python Class – Syntax and Semantics......Page 101
A Really Simple Class......Page 102
Encapsulation......Page 105
Example: A Deck of Cards......Page 106
Cat-a-Pult......Page 107
Detailed Design......Page 108
Non-Trivial Example: Objects in a Video Game......Page 112
Duck Typing......Page 114
Installing Pygame......Page 116
Essentials: The Graphics Window and Colors......Page 117
Pixel-Level Graphics......Page 118
Example: Create a Page of Notepaper......Page 119
Example: Creating a Color Gradient......Page 120
Example: Notepaper Again......Page 121
Polygons......Page 122
Blitting......Page 124
Drawing Text......Page 125
Transparent Colors......Page 126
Images......Page 127
Example: Thresholding......Page 128
Interaction......Page 129
Time......Page 130
The Mouse......Page 131
Button......Page 132
Stretchy Lines......Page 133
Sound......Page 134
The Lander......Page 135
Movement......Page 136
The Background......Page 137
Conclusion......Page 139
Dictionaries......Page 141
Functions for Dictionaries......Page 143
Arrays......Page 144
Formatted Text, Formatted I/O......Page 145
Example: NASA Meteorite Landing Data......Page 146
Both Strings Will Be Left Aligned......Page 147
Example: Create a File of Integers......Page 149
The Struct Module......Page 150
Example: A Video Game High Score File......Page 151
Random Access......Page 153
Example: Maintaining the High Score File in Order......Page 154
Chapter 9: Communication Using Python......Page 155
Example: Send an Email......Page 156
Example: Display the Subject Headers for Emails in Inbox......Page 159
Example: A Server That Calculates Squares......Page 163
Index......Page 168


πŸ“œ SIMILAR VOLUMES


Python 3 Pocket Primer
✍ Parker, James R πŸ“‚ Library πŸ“… 2017 πŸ› Mercury Learning & Information 🌐 English

This book is an effort to give programmers sufficient knowledge of Python 3 to be able to work on their own projects. Although it covers all of the basic concepts, the book features a chapter on<i>PyGame</i>, which allows a programmer to handle graphics, mouse and keyboard interaction, and play soun

cover
✍ Parker, J. R. (Jim R.), 1955- author πŸ“‚ Library πŸ“… 2018 πŸ› Dulles, Virginia : Mercury Learning & Information 🌐 English

1 online resource (210 pages)

Python pocket primer
✍ Campesato, Oswald πŸ“‚ Library πŸ“… 2014 πŸ› Mercury Learning and Information 🌐 English
Python 3 and Data Analytics Pocket Prime
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2021 πŸ› Mercury Learning and Information 🌐 English

As part of the best-selling <em>Pocket Primer</em> series, this book is designed to introduce the reader to the basic concepts of data analytics using Python 3. Itis intended to be a fast-paced introduction to some basic features of dataanalytics and also covers statistics, data visualization, and d

Python 3 and Data Analytics Pocket Prime
✍ Oswald Campesato πŸ“‚ Library πŸ› Mercury Learning and Information 🌐 English

<span>As part of the best-selling </span><span>Pocket Primer</span><span> series, this book is designed to introduce the reader to the basic concepts of data analytics using Python 3. It is intended to be a fast-paced introduction to some basic features of data analytics and also covers statistics,

Python Data Structures: Pocket Primer
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2022 πŸ› Mercury Learning and Information 🌐 English

As part of the best-selling Pocket Primer series, this book is designed to present the fundamentals of data structures using Python. Data structures provide a means to manage huge amounts of information such as large databases and the ability to use search and sort algorithms effectively. It is inte