mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
clean of unnecessary checks, imports, calls (#7993)
This commit is contained in:
@ -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
|
||||
|
@ -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):
|
||||
|
Reference in New Issue
Block a user