Completed 4-14 PEP 8 & 4-15 Code Review, modified 4-1, 4-2, & 4-3
This commit is contained in:
parent
57900c59da
commit
a0deee49bf
3
Chapter_04/4-14_pep8.py
Normal file
3
Chapter_04/4-14_pep8.py
Normal file
@ -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
|
||||||
11
Chapter_04/4-15_codeReview.py
Normal file
11
Chapter_04/4-15_codeReview.py
Normal file
@ -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
|
||||||
|
|
||||||
|
'''
|
||||||
@ -2,15 +2,11 @@
|
|||||||
# Learning Objective: Same as 4-1, utilize for loop.
|
# Learning Objective: Same as 4-1, utilize for loop.
|
||||||
|
|
||||||
animals = ['dog', 'cat', 'ferret']
|
animals = ['dog', 'cat', 'ferret']
|
||||||
|
|
||||||
'''
|
'''
|
||||||
for animal in animals:
|
for animal in animals:
|
||||||
print(animal)
|
print(animal)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
#modified:
|
#modified:
|
||||||
|
|
||||||
for animal in animals:
|
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!")
|
print("These animals all have 4 legs and make great pets!")
|
||||||
Loading…
x
Reference in New Issue
Block a user