clean of unnecessary checks, imports, calls (#7993)

This commit is contained in:
Mark Mayo
2022-11-21 00:00:27 +13:00
committed by GitHub
parent a25c53e8b0
commit f32d611689
27 changed files with 44 additions and 57 deletions

View File

@ -43,7 +43,7 @@ def fibonacci(n: int) -> int:
144
"""
if n == 1 or type(n) is not int:
if n == 1 or not isinstance(n, int):
return 0
elif n == 2:
return 1

View File

@ -32,7 +32,7 @@ def is_palindrome(n: int | str) -> bool:
False
"""
n = str(n)
return True if n == n[::-1] else False
return n == n[::-1]
def solution(n: int = 1000000):