Whenever you're ready, walk me through how you'd approach this.
Implement a function in Python to calculate the Fibonacci sequence. Assume the sequence starts with F(0) = 0 and F(1) = 1, and the function returns the first n terms. Explain the time and space complexity and handle invalid input appropriately.