$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · hard · #216
What is the output?
g = (i * i for i in range(3)) print(sum(g), sum(g))
5 5
5 0
0 5
3 3
A generator is consumed by the first sum; the second sees nothing and returns 0.
Play Problem Solving ▸
◂ #215
all Problem Solving — predict the output questions
#217 ▸