File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 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:
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+
5357def main ():
5458 """
5559 Request that user input an integer and tell them if it is Armstrong number.
Original file line number Diff line number Diff line change 55in its decimal fraction part.
66"""
77
8+
89def find_digit (numerator : int , digit : int ) -> int :
910 """
1011 Considering any range can be provided,
Original file line number Diff line number Diff line change 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' )} " )
You can’t perform that action at this time.
0 commit comments