diff --git a/Chapter_04/4-14_pep8.py b/Chapter_04/4-14_pep8.py new file mode 100644 index 0000000..22e8630 --- /dev/null +++ b/Chapter_04/4-14_pep8.py @@ -0,0 +1,3 @@ +# Exercise 4-14 PEP 8 +# Learning Objective: Get familiar with https://python.org/dv/peps/pep-0008 +# No coding necessary for this exercise \ No newline at end of file diff --git a/Chapter_04/4-15_codeReview.py b/Chapter_04/4-15_codeReview.py new file mode 100644 index 0000000..a0bc404 --- /dev/null +++ b/Chapter_04/4-15_codeReview.py @@ -0,0 +1,11 @@ +# Exercise 4-15 Code Review +# Learning Objective: Modify 3 programs to comply with PEP 8. + +''' +Modified Programs: + +4-1 +4-2 +4-3 + +''' \ No newline at end of file diff --git a/Chapter_04/4-1_pizzas.py b/Chapter_04/4-1_pizzas.py index 868fb61..599d81e 100644 --- a/Chapter_04/4-1_pizzas.py +++ b/Chapter_04/4-1_pizzas.py @@ -4,6 +4,6 @@ favoritePizzas = ['Meat lovers', 'White with Spinach and Feta', 'Pepperoni'] for pizza in favoritePizzas: - print(f"I like {pizza} pizza. \n") + print(f"I like {pizza} pizza. \n") print("I really love pizza!") \ No newline at end of file diff --git a/Chapter_04/4-2_animals.py b/Chapter_04/4-2_animals.py index e68edec..04b1aa0 100644 --- a/Chapter_04/4-2_animals.py +++ b/Chapter_04/4-2_animals.py @@ -2,15 +2,11 @@ # Learning Objective: Same as 4-1, utilize for loop. animals = ['dog', 'cat', 'ferret'] - ''' for animal in animals: print(animal) ''' - #modified: - for animal in animals: - print(f"A {animal} would make a great pet. \n") - + print(f"A {animal} would make a great pet. \n") print("These animals all have 4 legs and make great pets!") \ No newline at end of file diff --git a/Chapter_04/4-3_countingToTwenty.py b/Chapter_04/4-3_countingToTwenty.py index 3d9bcaf..3c2146d 100644 --- a/Chapter_04/4-3_countingToTwenty.py +++ b/Chapter_04/4-3_countingToTwenty.py @@ -2,5 +2,5 @@ # Learning Objective: Use for loop and range method. for number in range(1, 21): - print(number) + print(number)