Skip to content

Commit 8644500

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

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

maths/armstrong_numbers.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,19 @@ def armstrong_number(n: int) -> bool:
4141
temp //= 10
4242
return n == sum
4343

44-
def narcissistic_number(n:int) -> bool:
44+
45+
def narcissistic_number(n: int) -> bool:
4546
"""Return True if n is a narcissistic number or False if it is not"""
46-
47-
expo = len(str(n)) #power, all number will be raised to
48-
temp = [(int(i)**expo) for i in str(n)] # each digit will be multiplied expo times
49-
50-
# check if sum of cube of each digit is equal to number
47+
48+
expo = len(str(n)) # power, all number will be raised to
49+
temp = [
50+
(int(i) ** expo) for i in str(n)
51+
] # each digit will be multiplied expo times
52+
53+
# check if sum of cube of each digit is equal to number
5154
return n == sum(temp)
5255

56+
5357
def main():
5458
"""
5559
Request that user input an integer and tell them if it is Armstrong number.

project_euler/problem_26/sol1.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
in its decimal fraction part.
66
"""
77

8+
89
def find_digit(numerator: int, digit: int) -> int:
910
"""
1011
Considering any range can be provided,

web_programming/crawl_google_results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
print(len(links))
2121
if link.text == "Maps":
22-
webbrowser.open(link.get('href'))
22+
webbrowser.open(link.get("href"))
2323
else:
2424
webbrowser.open(f"http://google.com{link.get('href')}")

0 commit comments

Comments
 (0)