Skip to content

Commit 4e410da

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent c01d178 commit 4e410da

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

data_structures/heap/heap.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Heap(object):
2323
[1, 5, 7, 9, 11, 15, 25, 100, 103, 107, 201]
2424
>>>
2525
"""
26+
2627
def __init__(self):
2728
self.h = []
2829
self.curr_size = 0
@@ -107,28 +108,28 @@ def main():
107108
[2, 5, 3, 0, 2, 3, 0, 3],
108109
[6, 1, 2, 7, 9, 3, 4, 5, 10, 8],
109110
[103, 9, 1, 7, 11, 15, 25, 201, 209, 107, 5],
110-
[-45, -2, -5]
111+
[-45, -2, -5],
111112
]:
112-
print('source unsorted list: %s' % unsorted)
113+
print("source unsorted list: %s" % unsorted)
113114

114115
h = Heap()
115116
h.build_heap(unsorted)
116-
print('after build heap: ', end=' ')
117+
print("after build heap: ", end=" ")
117118
h.display()
118119

119-
print('max value: %s' % h.get_max())
120-
print('delete max value: ', end=' ')
120+
print("max value: %s" % h.get_max())
121+
print("delete max value: ", end=" ")
121122
h.display()
122123

123124
h.insert(100)
124-
print('after insert new value 100: ', end=' ')
125+
print("after insert new value 100: ", end=" ")
125126
h.display()
126127

127128
h.heap_sort()
128-
print('heap sort: ', end=' ')
129+
print("heap sort: ", end=" ")
129130
h.display()
130131
print()
131132

132133

133-
if __name__ == '__main__':
134+
if __name__ == "__main__":
134135
main()

data_structures/linked_list/swap_nodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self):
1414
def print_list(self):
1515
temp = self.head
1616
while temp is not None:
17-
print(temp.data, end=' ')
17+
print(temp.data, end=" ")
1818
temp = temp.next
1919
print()
2020

project_euler/problem_30/soln.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ def digitsum(s: str) -> int:
3030

3131

3232
if __name__ == "__main__":
33-
count = sum(digitsum(str(i)) for i in range(1000,1000000))
33+
count = sum(digitsum(str(i)) for i in range(1000, 1000000))
3434
print(count) # --> 443839

0 commit comments

Comments
 (0)