0%

Book Description

Python Workout presents 50 exercises that focus on key Python 3 features. In it, expert Python coach Reuven Lerner guides you through a series of small projects, practicing the skills you need to tackle everyday tasks. You’ll appreciate the clear explanations of each technique, and you can watch Reuven solve each exercise in the accompanying videos.

Table of Contents

  1. Python Workout
  2. Copyright
  3. dedication
  4. brief contents
  5. contents
  6. front matter
    1. preface
    2. acknowledgments
    3. about this book
      1. Who should read this book
      2. How this book is organized: a roadmap
      3. About the code
      4. Software/hardware requirements
      5. liveBook discussion forum
    4. about the author
    5. about the cover illustration
  7. 1 Numeric types
    1. Useful references
    2. Exercise 1 ■ Number guessing game
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 2 ■ Summing numbers
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 3 ■ Run timing
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 4 ■ Hexadecimal output
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Summary
  8. 2 Strings
    1. Useful references
    2. Exercise 5 ■ Pig Latin
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 6 ■ Pig Latin sentence
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 7 ■ Ubbi Dubbi
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 8 ■ Sorting a string
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Summary
  9. 3 Lists and tuples
    1. Exercise 9 ■ First-last
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 10 ■ Summing anything
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 11 ■ Alphabetizing names
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 12 ■ Word with most repeated letters
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 13 ■ Printing tuple records
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Summary
  10. 4 Dictionaries and sets
    1. Hashing and dicts
    2. Sets
    3. Exercise 14 ■ Restaurant
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 15 ■ Rainfall
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 16 ■ Dictdiff
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Exercise 17 ■ How many different numbers?
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    7. Summary
  11. 5 Files
    1. Exercise 18 ■ Final line
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 19 ■ /etc/passwd to dict
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 20 ■ Word count
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 21 ■ Longest word per file
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 22 ■ Reading and writing CSV
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Exercise 23 ■ JSON
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    7. Exercise 24 ■ Reverse lines
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    8. Summary
  12. 6 Functions
    1. Exercise 25 ■ XML generator
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 26 ■ Prefix notation calculator
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 27 ■ Password generator
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Summary
  13. 7 Functional programming with comprehensions
    1. Exercise 28 ■ Join numbers
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 29 ■ Add numbers
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 30 ■ Flatten a list
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 31 ■ Pig Latin translation of a file
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 32 ■ Flip a dict
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Exercise 33 ■ Transform values
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    7. Exercise 34 ■ (Almost) supervocalic words
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    8. Exercise 35a ■ Gematria, part 1
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    9. Exercise 35b ■ Gematria, part 2
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    10. Summary
  14. 8 Modules and packages
    1. Exercise 36 ■ Sales tax
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 37 ■ Menu
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Summary
  15. 9 Objects
    1. Exercise 38 ■ Ice cream scoop
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 39 ■ Ice cream bowl
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 40 ■ Bowl limits
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 41 ■ A bigger bowl
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 42 ■ FlexibleDict
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Exercise 43 ■ Animals
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    7. Exercise 44 ■ Cages
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    8. Exercise 45 ■ Zoo
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    9. Summary
  16. 10 Iterators and generators
    1. Exercise 46 ■ MyEnumerate
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    2. Exercise 47 ■ Circle
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    3. Exercise 48 ■ All lines, all files
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    4. Exercise 49 ■ Elapsed since
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    5. Exercise 50 ■ MyChain
      1. Working it out
      2. Solution
      3. Screencast solution
      4. Beyond the exercise
    6. Summary
    7. Conclusion
  17. index
18.221.15.15