My code is showing this statement after running:
<main.next at 0x243f31fd130>
my code :
def fib():
prev,curr=0,1
while True:
yield curr
prev,curr=curr,prev+curr
gen=fib()
print(next(gen))
Note*-I ran it on jupyter notebook
My code is showing this statement after running:
<main.next at 0x243f31fd130>
my code :
def fib():
prev,curr=0,1
while True:
yield curr
prev,curr=curr,prev+curr
gen=fib()
print(next(gen))
Note*-I ran it on jupyter notebook