Skip to content

Commit

Permalink
Fix code style issues with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Feb 4, 2023
1 parent 7ab6cb6 commit 753b927
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions 3_advanced/chapter17/solutions/min_superset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# of minimum size which is the superset of all the given sets.
# Implement the following method:


# superset calcuated using Principle of Inclusion and Exclusion
# sets: a vector containing 3 sets
def findMinSupersetLength(sets):
Expand Down
2 changes: 1 addition & 1 deletion dsa/chapter1/practice/time_complexity_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def example_six(n):

# what is the runtime for example 7?
def example_seven(n):
for i in range(2 ** n):
for i in range(2**n):
do_something()


Expand Down
3 changes: 2 additions & 1 deletion dsa/chapter1/solutions/time_complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
are examples and not the only ways to have done this problem.
"""


# time complexity: O(1)
def double_my_number(number):
x = number
Expand Down Expand Up @@ -84,7 +85,7 @@ def get_binary_combinations(number_of_digits):
# function with O(2**n) runtime.
def regular_o_2_to_the_n(n):
operations = 0
for i in range(2 ** n):
for i in range(2**n):
operations += 1
print(f"took {operations} operations")

Expand Down
2 changes: 1 addition & 1 deletion dsa/chapter1/solutions/time_complexity_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def example_six(n):
# what is the runtime for example 7?
# runtime is O(2**n)
def example_seven(n):
for i in range(2 ** n):
for i in range(2**n):
do_something()


Expand Down
2 changes: 1 addition & 1 deletion dsa/chapter3/solutions/selectionsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def selectionsort(arr: list):
for i in range(len(arr)):
# Step 2, create an inner loop that iterates from i+1 to the end of the
# list, let's name inner index "j"
for j in range(i+1, len(arr)):
for j in range(i + 1, len(arr)):
# Step 3, check if the element at index i is larger than the
# element at index j
if arr[i] > arr[j]:
Expand Down
1 change: 0 additions & 1 deletion games/chapter1/solution/blackjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def hit(cards):

exit()
if sum(dealerList) == 21 and sum(userList) == 21:

print("It is a tie")
exit()
if sum(dealerList) == 21:
Expand Down
3 changes: 0 additions & 3 deletions games/chapter3/solutions/SpaceCounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
run = True

while run:

# Render the "display_counter" to the screen
show_counter = font.render(str(display_counter), True, (255, 192, 203))

Expand All @@ -29,10 +28,8 @@

# Checks to see if key is pressed
if event.type == pygame.KEYDOWN:

# Checks to see if the space is pressed
if event.key == pygame.K_SPACE:

# Adds one to the counter
display_counter += 1

Expand Down

0 comments on commit 753b927

Please sign in to comment.