Commit ee51eff 1 parent 47d123f commit ee51eff Copy full SHA for ee51eff
File tree 5 files changed +7
-7
lines changed
5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def compute():
14
14
for j in range (100 , 1000 ):
15
15
k = i * j
16
16
s = str (k )
17
- if s == s [:: - 1 ] and k > ans :
17
+ if s == s [ : : - 1 ] and k > ans :
18
18
ans = k
19
19
return str (ans )
20
20
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ def compute():
18
18
19
19
def is_decimal_binary_palindrome (n ):
20
20
s = str (n )
21
- if s != s [:: - 1 ]:
21
+ if s != s [ : : - 1 ]:
22
22
return False
23
23
t = bin (n )[2 : ]
24
- return t == t [:: - 1 ]
24
+ return t == t [ : : - 1 ]
25
25
26
26
27
27
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ def compute():
14
14
15
15
def is_lychrel (n ):
16
16
for i in range (50 ):
17
- n += int (str (n )[:: - 1 ])
18
- if str (n ) == str (n )[:: - 1 ]:
17
+ n += int (str (n )[ : : - 1 ])
18
+ if str (n ) == str (n )[ : : - 1 ]:
19
19
return False
20
20
return True
21
21
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def compute():
14
14
for i in itertools .count (1 ):
15
15
s = str (i )
16
16
t = "" .join (sorted (s ))
17
- if s != t and s [:: - 1 ] != t :
17
+ if s != t and s [ : : - 1 ] != t :
18
18
count += 1 # i is bouncy
19
19
if count * 100 == 99 * i :
20
20
return str (i )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def compute():
18
18
if sigma >= 100000000 :
19
19
break
20
20
s = str (sigma )
21
- if s == s [:: - 1 ]: # Is palindrome
21
+ if s == s [ : : - 1 ]: # Is palindrome
22
22
nums .add (sigma )
23
23
return str (sum (nums ))
24
24
You can’t perform that action at this time.
0 commit comments