Python for Everybody - Interactive¶
Assignments¶
Table of Contents¶
- 1. Why Program?
- 1.1. Why should you learn to write programs?
- 1.2. Creativity and motivation
- 1.3. Computer hardware architecture
- 1.4. Understanding programming
- 1.5. Words and sentences in Python
- 1.6. Conversing with Python
- 1.7. Terminology: Interpreter and compiler
- 1.8. Writing a program
- 1.9. What is a program?
- 1.10. The building blocks of programs
- 1.11. What could possibly go wrong?
- 1.12. Debugging
- 1.13. The learning journey
- 1.14. Glossary
- 1.15. Exercises
- 2. Variables, Expressions, and Statements
- 2.1. Values and types
- 2.2. Variables
- 2.3. Variable names and keywords
- 2.4. Statements
- 2.5. Operators and operands
- 2.6. Expressions
- 2.7. Order of operations
- 2.8. Modulus operator
- 2.9. String operations
- 2.10. Asking the user for input
- 2.11. Comments
- 2.12. Choosing mnemonic variable names
- 2.13. Debugging
- 2.14. Glossary
- 2.15. Mulitple Choice Questions
- 2.16. Mixed-up Code Questions
- 2.17. Write Code Questions
- 3. Conditional Execution
- 3.1. Boolean expressions
- 3.2. Logical operators
- 3.3. Conditional execution
- 3.4. Alternative execution
- 3.5. Chained conditionals
- 3.6. Nested conditionals
- 3.7. Catching exceptions using try and except
- 3.8. Short-circuit evaluation of logical expressions
- 3.9. Debugging
- 3.10. Glossary
- 3.11. Multiple Choice Questions
- 3.12. Mixed-up Code Questions
- 3.13. Write Code Questions
- 4. Functions
- 4.1. Function calls
- 4.2. Built-in functions
- 4.3. Type conversion functions
- 4.4. Math functions
- 4.5. Random numbers
- 4.6. Adding new functions
- 4.7. Definitions and uses
- 4.8. Flow of execution
- 4.9. Parameters and arguments
- 4.10. Fruitful functions and void functions
- 4.11. Why functions?
- 4.12. Debugging
- 4.13. Glossary
- 4.14. Multiple Choice Questions
- 4.15. Mixed-up Code Questions
- 4.16. Write Code Questions
- 4.17. Group Work: Functions
- 4.18. Group Work: Functions and Strings
- 4.19. Group Work: Functions and Conditionals
- 4.20. Group Work: Functions and Lists
- 4.21. Group Work: Functions with Loops
- 5. Loops and Iterations
- 6. Strings
- 6.1. A string is a sequence
- 6.2. Getting the length of a string using
len()
- 6.3. Traversal through a string with a loop
- 6.4. String slices
- 6.5. Strings are immutable
- 6.6. Looping and counting
- 6.7. The
in
operator - 6.8. String comparison
- 6.9. String methods
- 6.10. Parsing strings
- 6.11. Format operator
- 6.12. Debugging
- 6.13. Glossary
- 6.14. Multiple Choice Questions
- 6.15. Mixed-up Code Questions
- 6.16. Write Code Questions
- 7. Files
- 7.1. Persistence
- 7.2. Opening files
- 7.3. Text files and lines
- 7.4. Reading files
- 7.5. Searching through a file
- 7.6. Letting the user choose the file name
- 7.7. Using
try, except,
andopen
- 7.8. Writing files
- 7.9. Debugging
- 7.10. Glossary
- 7.11. Multiple Choice Questions
- 7.12. Mixed-up Code Questions
- 7.13. Write Code Questions
- 8. Lists
- 8.1. A list is a sequence
- 8.2. Lists are mutable
- 8.3. Traversing a list
- 8.4. List operations
- 8.5. List slices
- 8.6. List methods
- 8.7. Deleting elements
- 8.8. Lists and functions
- 8.9. Lists and strings
- 8.10. Parsing lines
- 8.11. Objects and values
- 8.12. Aliasing
- 8.13. List arguments
- 8.14. Debugging
- 8.15. Glossary
- 8.16. Multiple Choice Questions
- 8.17. Mixed-up Code Questions
- 8.18. Write Code Questions
- 8.19. Group Work: Lists and Strings
- 9. Dictionaries
- 10. Tuples
- 10.1. Tuples are Immutable
- 10.2. Comparing Tuples
- 10.3. Tuple Assignment
- 10.4. Dictionaries and Tuples
- 10.5. Multiple Assignment with Dictionaries
- 10.6. The Most Common Words
- 10.7. Using Tuples as Keys in Dictionaries
- 10.8. Sequences: Strings, Lists, and Tuples - Oh My!
- 10.9. Debugging
- 10.10. Glossary
- 10.11. Multiple Choice Questions
- 10.12. Mixed-Up Code Questions
- 10.13. Write Code Questions
- 11. Regular Expressions
- 11.1. Regular Expressions
- 11.2. Character Matching in Regular Expressions
- 11.3. Extracting Data Using Regular Expressions
- 11.4. Combining Searching and Extracting
- 11.5. Escape Character
- 11.6. Summary
- 11.7. Bonus section for Unix / Linux users
- 11.8. Debugging
- 11.9. Glossary
- 11.10. Multiple Choice Questions
- 11.11. Mixed-Up Code Questions
- 11.12. Write Code Questions
- 12. Network Programming
- 12.1. Networked programs
- 12.2. HyperText Transfer Protocol - HTTP
- 12.3. The world’s simplest web browser
- 12.4. Retrieving an image over HTTP
- 12.5. Retrieving web pages with
urllib
- 12.6. Reading binary files using
urllib
- 12.7. Parsing HTML and scraping the web
- 12.8. Parsing HTML using regular expressions
- 12.9. Parsing HTML using BeautifulSoup
- 12.10. HTML
- 12.11. BeautifulSoup with Requests
- 12.12. Bonus section for Unix / Linux users
- 12.13. Glossary
- 12.14. Multiple Choice Questions
- 12.15. Mixed-Up Code Exercises
- 12.16. Write Code Exercises
- 13. Using Web Services
- 13.1. eXtensible Markup Language - XML
- 13.2. Parsing XML
- 13.3. Looping through nodes
- 13.4. JavaScript Object Notation - JSON
- 13.5. Parsing JSON
- 13.6. Application Programming Interfaces
- 13.7. Security and API usage
- 13.8. Glossary
- 13.9. Multiple Choice Questions
- 13.10. Mixed-Up Code Questions
- 13.11. Write Code Questions
- 13.12. Application 1: Google geocoding web service
- 13.13. Application 2: Twitter
- 14. Object-Oriented Programming
- 14.1. Managing larger programs
- 14.2. Getting started
- 14.3. Using objects
- 14.4. Starting with programs
- 14.5. Subdividing a problem
- 14.6. Our first Python object
- 14.7. Classes as types
- 14.8. Object lifecycle
- 14.9. Multiple instances
- 14.10. Inheritance
- 14.11. Summary
- 14.12. Glossary
- 14.13. Multiple Choice Questions
- 14.14. Mixed-Up Code Exercises
- 14.15. Write Code Exercises
- 14.16. POGIL Activity - Classes, constructors, attributes, and methods
- 15. Turtles: An Introduction to Objects and Classes
- 15.1. History of Turtles
- 15.2. Practice with Turtles
- 15.3. Turtle Methods
- 15.4. Single and Multiple Turtles
- 15.5. Using Repetition with Turtles
- 15.6. Teacher Note: Turtle Geometry
- 15.7. Total Turtle Trip Theorem
- 15.8. Making Patterns within Patterns
- 15.9. The Turtle Stamp Procedure
- 15.10. Chapter 5 - Summary
- 15.11. Chapter 5 Exercises
- 16. Picture Class and Methods
- 16.1. Using Repetition with Images
- 16.2. A Library of Images
- 16.3. Understanding Image Representation
- 16.4. A Pattern for Image Processing
- 16.5. Changing Step 5: Increasing and decreasing color values
- 16.6. Changing Step 6: Changing where we put the colors
- 16.7. Changing Step 3: Changing which data we use
- 16.8. Chapter 11 - Summary
- 16.9. Chapter 11 Exercises
- 17. Databases
- 17.1. What is a database?
- 17.2. Database concepts
- 17.3. Database Browser for SQLite
- 17.4. Creating a database table
- 17.5. Structured Query Language summary
- 17.6. Spidering Twitter using a database
- 17.7. Basic data modeling
- 17.8. Programming with multiple tables
- 17.9. Three kinds of keys
- 17.10. Using JOIN to retrieve data
- 17.11. Summary
- 17.12. Debugging
- 17.13. Glossary
- 17.14. Multiple Choice Questions
- 17.15. Mixed-Up Code Questions
- 17.16. Write Code Questions
- 18. Data Visualization
Acknowledgements¶
Acknowledgements, Contributors, License, and Preface
Indices¶
You have attempted of activities on this page