+ 1

Can someone explain this output?

x = [i for i in range(11) if i%==0] n=0 for j in x: n+=j print(n) I do not understand how the answer is 30 for range 11 should be all from 0 to 10 and i modulus==0

26th Nov 2019, 10:29 AM
THEGreatGatsby
THEGreatGatsby - avatar
3 Respostas
0
but why do we ise 2,4,6,8,10?
26th Nov 2019, 12:37 PM
THEGreatGatsby
THEGreatGatsby - avatar