Skip to content

Commit b0aff3e

Browse files
committed
Cleanup
1 parent 026379d commit b0aff3e

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

ch06-functions-and-loops/2-write-your-own-functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Exercise 1
66
def cube(num):
77
"""Return the cube of the input number."""
8-
cube_num = num ** 3 # Could also use pow(num, 3)
8+
cube_num = num**3 # Could also use pow(num, 3)
99
return cube_num
1010

1111

ch08-conditional-logic/2-add-some-logic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# 8.2 - Add Some Logic
22
# Solutions to review exercises
33

4-
# --- Exercise 1
4+
# Exercise 1
55
# Test whether these expressions are True or False
66
print((1 <= 1) and (1 != 1))
77
print(not (1 != 2))
88
print(("good" != "bad") or False)
99
print(("good" != "Good") and not (1 == 1))
1010

11-
# --- Exercise 2
11+
# Exercise 2
1212
# Add parentheses so that the following expressions all
1313
# evaluate to True
1414

ch08-conditional-logic/3-control-the-flow-of-your-program.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Solutions to review exercises
33

44

5-
# --- Exercise 1
5+
# Exercise 1
66
# Display whether the length of user input is <, > or = 5 characters
77

88
my_input = input("Type something: ")
@@ -15,7 +15,7 @@
1515
print("Your input is 5 characters long.")
1616

1717

18-
# --- Exercise 2
18+
# Exercise 2
1919
# Number guessing program ("guess" the number 3)
2020

2121
print("I'm thinking of a number between 1 and 10. Guess which one.")

ch12-file-input-and-output/3-common-file-system-operations.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
file1.unlink()
3030

3131

32-
# # Exercise 5
32+
# Exercise 5
3333
import shutil
34+
3435
shutil.rmtree(new_dir)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Exercise 3
1919
# Square every entry and save in a new matrix
20-
second_matrix = first_matrix ** 2
20+
second_matrix = first_matrix**2
2121

2222
# Exercise 4
2323
# Put first_matrix on top of second_matrix

0 commit comments

Comments
 (0)