File tree 3 files changed +12
-7
lines changed
3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,19 @@ def armstrong_number(n: int) -> bool:
41
41
temp //= 10
42
42
return n == sum
43
43
44
- def narcissistic_number (n :int ) -> bool :
44
+
45
+ def narcissistic_number (n : int ) -> bool :
45
46
"""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
51
54
return n == sum (temp )
52
55
56
+
53
57
def main ():
54
58
"""
55
59
Request that user input an integer and tell them if it is Armstrong number.
Original file line number Diff line number Diff line change 5
5
in its decimal fraction part.
6
6
"""
7
7
8
+
8
9
def find_digit (numerator : int , digit : int ) -> int :
9
10
"""
10
11
Considering any range can be provided,
Original file line number Diff line number Diff line change 19
19
20
20
print (len (links ))
21
21
if link .text == "Maps" :
22
- webbrowser .open (link .get (' href' ))
22
+ webbrowser .open (link .get (" href" ))
23
23
else :
24
24
webbrowser .open (f"http://google.com{ link .get ('href' )} " )
You can’t perform that action at this time.
0 commit comments