I’ve been learning 6.1.1 executing modules as scripts from this site and i’m so confused. This is my code and its correct up to the <if **name** == “**main**”:> part but then i keep getting an error saying IndexError and i don’t understand why, i practically just copied the code off the site but the sites pretty confusing too… Can you pls tell me where i went wrong? thank you!

```
def fib(n): #write Fibonacci series up to n
a,b = 0,1
while a<n:
print(a, end = '')
a, b = b, a+b
print()
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0,1
while a < n:
result.append(a)
a, b = b, a+b
return result
print()
if __name__ == "__main__":
import sys
print(fib(int(sys.argv[1])))
```