




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































2 N D E D I T I O N
P y t h o n
C r a s h C o u r s e
2 n d e d i t i o n
a h a n d s - o n , P r o j e c t - B a s e d
i n t r o d u c t i o n t o P r o g r a m m i n g
by Eric Matthes
About the Author
About the Technical Reviewer
Preface to the Second Edition xxvii
Acknowledgments xxxi
C o n t e n t s i n D e t a i l
Who Is This Book For? xxxiv What Can You Expect to Learn? xxxiv Online Resources xxxv Why Python? xxxvi
Part i: BaSicS 1
Setting Up Your Programming Environment 3 Python Versions 4 Running Snippets of Python Code 4 About the Sublime Text Editor 4 Python on Different Operating Systems 5 Python on Windows 5 Python on macOS 7 Python on Linux 8 Running a Hello World Program 9 Configuring Sublime Text to Use the Correct Python Version 9 Running hello_world py 10 Troubleshooting 11 Running Python Programs from a Terminal 12 On Windows 12 On macOS and Linux 12 Exercise 1-1: python.org...................................... 13 Exercise 1-2: Hello World Typos................................. 13 Exercise 1-3: Infinite Skills..................................... 13 Summary 13
What Really Happens When You Run hello_world py 15 Variables 16 Naming and Using Variables 17 Avoiding Name Errors When Using Variables 17 Variables Are Labels 18 Exercise 2-1: Simple Message.................................. 19 Exercise 2-2: Simple Messages.................................. 19
xiv Contents in Detail
Contents in Detail xvii