I have defined a factorial
function which looks as below:
def fact(n):
return 1 if n < 2 else n * fact(n-1)
Now, I am running map
function as below:
results = map(fact, range(1,5))
for x in results:
print(x)
Output:
1
2
6
24
I am completely understanding the above output. However, if I run the same for loop again I am getting a blank output which I am not able to understand.
for x in results:
print(x)
Output: