Post

Waclaw Koscielniak
Waclaw Koscielniak@Vatsek·
@Python_Dv C. x = (i for i in range(3)) for i in x: print(i, end=" ") for j in x: print(j, end=" ") [Running] python3 -u "/Users/name/test/test.py" 0 1 2 [Done] exited with code=0 in 0.056 seconds
English
0
0
0
59
Albert Chidi
Albert Chidi@achidi48·
@Python_Dv The output is option C: The print(j, end=" ") is redundant because the value of 'x' is a generator object. The object of a generator is produced on a fly (once) which in this case happened in print(i, end=" ”). So the output is 0 1 2.
English
0
0
0
126
Decotechs
Decotechs@TechsDeco·
@Python_Dv I'm curious to see the responses! Python can be tricky at times, but it's always insightful to discuss and learn from each other's thought processes. Looking forward to the answers!
English
0
0
0
28
Yun Sensei
Yun Sensei@yun5ensei·
@Python_Dv The quality of code largely depends on context. Seeking clarity is admirable.
English
0
0
0
58
Paylaş