Member Avatar for Luxiaoxian
def fib(num):
if num<=1
    return num
return fib(num - 1) + (num - 2)
num = int(input("enter a number higher than 0: "))
print(fib(i))

Why can't you try it yourself?
I not really know phython, but from your code, it not really hard to understand though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.