Skip to content

Commit c5b3da1

Browse files
authored
Merge pull request realpython#7 from realpython/flake8-run
Cleanup pass
2 parents c638e62 + e27f00a commit c5b3da1

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

ch08-conditional-logic/8-assignment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
A_win += 1
2626
else:
2727
B_win += 1
28-
# determine overall election outcome
28+
# Determine overall election outcome
2929
if A_win > B_win:
3030
total_A_wins += 1
3131
else:

ch09-lists-and-dictionaries/2-assignment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
def enrollment_stats(list_of_universities):
66

7-
# variables
7+
# Variables
88
total_students = []
99
total_tuition = []
1010

11-
# iterate through lists, adding values
11+
# Iterate through lists, adding values
1212
for university in list_of_universities:
1313
total_students.append(university[1])
1414
total_tuition.append(university[2])
1515

16-
# return variables
16+
# Return variables
1717
return total_students, total_tuition
1818

1919

ch11-file-input-and-output/2-working-with-paths-in-python.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
# Exercise 3
2828
# Change all PNGs to JPGs in the "images" folder and its subfolders
29-
# Could use indexing to get the file extension, but try using os.path.splitext()
29+
# Could use indexing to get the file extension, but try using
30+
# os.path.splitext()
3031
for current_folder, subfolders, file_names in os.walk(path):
3132
for file_name in file_names:
3233
file_path = os.path.join(current_folder, file_name)

ch16-scientific-computing-and-graphing/1-use-numpy-for-matrix-manipulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
# Exercise 2
1414
# Display the min, max and mean of all entries in the matrix
15-
print "Min is", first_matrix.min()
16-
print "Max is", first_matrix.max()
17-
print "Mean is", first_matrix.mean()
15+
print("Min is", first_matrix.min())
16+
print("Max is", first_matrix.max())
17+
print("Mean is", first_matrix.mean())
1818

1919
# Exercise 3
2020
# Square every entry and save in a new matrix

ch16-scientific-computing-and-graphing/2-use-matplotlib-for-plotting-graphs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
# Exercise 2
1313
# Display the min, max and mean of all entries in the matrix
14-
print(f"Min is {first_matrix.min(}")
14+
print(f"Min is {first_matrix.min()}")
1515
print(f"Max is {first_matrix.max()}")
16-
print(f"Mean is {first_matrix.mean()}"}
16+
print(f"Mean is {first_matrix.mean()}")
1717

1818
# Exercise 3
1919
# Square every entry and save in a new matrix

ch17-graphical-user-interfaces/6-assignment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def make_poem():
3838
or len(preposition) < 2 or len(adverb) < 1:
3939
result_poem.config(
4040
text="Did you think you could get away that easily?\n\
41-
Enter at least three nouns, three verbs, three adjectives, two prepositions and an adverb!")
41+
Enter at least three nouns, three verbs, three adjectives, \
42+
two prepositions and an adverb!")
4243
return
4344

4445
# otherwise, we can go ahead with generating a poem:

0 commit comments

Comments
 (0)