+ 1
Why i cannot import all functions using import itertools ?
from itertools import count for i in count(3): print(i) if(i>11): break Output: 3 4 5 6 7 8 9 10 11 12 ******************************************************************************************************** But now using this: import itertools for i in count(3): print(i) if(i>11): break Output: NameError: name 'count' is not defined Why does this occur?? Thanking u in advance... :)
1 Odpowiedź
+ 1
use
for i in itertools.count(3):