<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write code to return the kth element in the Fibonacci sequence.
<|im_end|>
<|im_start|>assistant
def return_fibonacci(k):
    a = 0
    b = 1
    if k < 0:
        return "Incorrect input"
    elif k == 0:
        return a
    elif k == 1:
        return b
    else:
        for i in range(2, k+1):
            c = a + b
            a = b
            b = c
        return b<|im_end|>
