12 lines
239 B
Python
12 lines
239 B
Python
|
def fibonacci(n):
|
||
|
if n == 1:
|
||
|
return 1
|
||
|
return fibonacci(n-1) + fibonacci(n-2)
|
||
|
|
||
|
def is_palindrome(str):
|
||
|
reversed_str = ''.join(reversed(str))
|
||
|
if str == reversed_str:
|
||
|
return True
|
||
|
else:
|
||
|
return False
|