I ran this code for an exercise in python 2.7 but I get the same error everytime, no matter how I call the function fib(n) and I don't know why it doesnt get it. here's the code :
#!/usr/bin/python
class fibonacci:
def fib(self,n):
a=1
b=0
c=0
count=0
fibo=list()
while count < n:
c = a + b
fibo.append(n)
fibo.append(c)
a = b
b = c
count += 1
return fibo
n=int(raw_input("ingrese n: "))
s = fib(n)
print s
when I run it I get this error:
Traceback (most recent call last):
File "./fib.py", line 22, in <module>
s=fib(n)
NameError: name 'fib' is not defined
user@debian:~/Documents$
help please