AutomateTheBoringStuff.Ch04 package

Submodules

AutomateTheBoringStuff.Ch04.P1_allMyCats1 module

All my cats 1.0

This program inefficiently showcases your cats by prompting for user input for each cat.

AutomateTheBoringStuff.Ch04.P1_allMyCats1.main()[source]

AutomateTheBoringStuff.Ch04.P2_allMyCats2 module

All my cats 2.0

This program efficiently showcases your cats by using a list to store the cat’s names and a while loop to prompt for them. Then, using a for loop on the list to print them all.

AutomateTheBoringStuff.Ch04.P2_allMyCats2.main()[source]

AutomateTheBoringStuff.Ch04.P3_myPets module

My pets

This program checks if a given pet’s name is in a list of pet names.

AutomateTheBoringStuff.Ch04.P3_myPets.main()[source]

AutomateTheBoringStuff.Ch04.P4_magic8Ball2 module

Magic 8 Ball 2.0

This program more efficiently answers your questions by indexing a list with the answer strings.

AutomateTheBoringStuff.Ch04.P4_magic8Ball2.main()[source]

AutomateTheBoringStuff.Ch04.P5_passingReference module

Passing reference

This program demonstrates how mutable data types are passed to functions by using the eggs() function to append a string to a list of integers.

AutomateTheBoringStuff.Ch04.P5_passingReference.eggs(someParameter: list) → None[source]

Appends ‘hello’ to a given list.

Parameters:someParameter – List to append to.
Returns:None.
AutomateTheBoringStuff.Ch04.P5_passingReference.main()[source]

Module contents