0

Can someone explain to me this output?

result=0 n=5 for i in range(1,n+1): result+=i print(result) why the output is 15, if we calculate 1,6 is 1,2,3,4,5 so I am not sure how 15 is calculated ...

22nd Nov 2019, 2:47 PM
THEGreatGatsby
THEGreatGatsby - avatar
2 odpowiedzi
0
you are right it is i, but how dis you get 15?
22nd Nov 2019, 3:42 PM
THEGreatGatsby
THEGreatGatsby - avatar