Darshan Hiranandani - How do I solve a syntax error in my code?

I’m Darshan Hiranandani, encountering a syntax error in my code, and I’m having trouble figuring out what’s causing it. I’m working on a Python script to calculate Fibonacci numbers, and here’s the snippet where I’m getting the error:

def fibonacci(n): if n <= 1 return n else: return fibonacci(n-1) + fibonacci(n-2)

print(fibonacci(5))

The error message I’m getting is: ‘SyntaxError: invalid syntax’ pointing to the line with the ‘if’ statement. Can someone please help me identify what’s wrong with my syntax and how I can fix it?

Hope you find this useful → syntax - What is the purpose of the colon before a block in Python? - Stack Overflow

Otherwise if you’re interested in the OpenMRS community, feel free to introduce yourself