contents

preface

acknowledgments

about this book

about the author

about the cover illustration

1 Numeric types

Useful references

Exercise 1 Number guessing game

Exercise 2 Summing numbers

Exercise 3 Run timing

Exercise 4 Hexadecimal output

2 Strings

Useful references

Exercise 5 Pig Latin

Exercise 6 Pig Latin sentence

Exercise 7 Ubbi Dubbi

Exercise 8 Sorting a string

3 Lists and tuples

Exercise 9 First-last

Exercise 10 Summing anything

Exercise 11 Alphabetizing names

Exercise 12 Word with most repeated letters

Exercise 13 Printing tuple records

4 Dictionaries and sets

Hashing and dicts

Sets

Exercise 14 Restaurant

Exercise 15 Rainfall

Exercise 16 Dictdiff

Exercise 17 How many different numbers?

5 Files

Exercise 18 Final line

Exercise 19 /etc/passwd to dict

Exercise 20 Word count

Exercise 21 Longest word per file

Exercise 22 Reading and writing CSV

Exercise 23 JSON

Exercise 24 Reverse lines

6 Functions

Exercise 25 XML generator

Exercise 26 Prefix notation calculator

Exercise 27 Password generator

7 Functional programming with comprehensions

Exercise 28 Join numbers

Exercise 29 Add numbers

Exercise 30 Flatten a list

Exercise 31 Pig Latin translation of a file

Exercise 32 Flip a dict

Exercise 33 Transform values

Exercise 34 (Almost) supervocalic words

Exercise 35a Gematria, part 1

Exercise 35b Gematria, part 2

8 Modules and packages

Exercise 36 Sales tax

Exercise 37 Menu

9 Objects

Exercise 38 Ice cream scoop

Exercise 39 Ice cream bowl

Exercise 40 Bowl limits

Exercise 41 A bigger bowl

Exercise 42 FlexibleDict

Exercise 43 Animals

Exercise 44 Cages

Exercise 45 Zoo

10 Iterators and generators

Exercise 46 MyEnumerate

Exercise 47 Circle

Exercise 48 All lines, all files

Exercise 49 Elapsed since

Exercise 50 MyChain

index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset