"""
Recommended Python Style Guide:
https://peps.python.org/pep-0008/#introduction
"""


def fibonacci(n):
    # Return n if 0 or 1 to correctly handle the base cases
    if n <= 1:
        return n
    else:
        # Recursively calculate the sum of the two previous Fibonacci numbers
        return fibonacci(n-1) + fibonacci(n-2)

# Prompt user to enter a value for n and check for non-negative input
n = int(input("n: "))
while n < 0:
    print("Please input a non-negative value for n.")
    n = int(input("n: "))

# Output the Fibonacci result
print(f"fibonacci({n}) = {fibonacci(n)}")

