0

Python - need help please!

in functions and modules - final quizz - final question, can you tell me why the hell is answer 6?

25th Jan 2017, 11:09 PM
Tazo Qitiashvili
Tazo Qitiashvili - avatar
1 Answer
0
look it is easy: 'res' is equal to 0 then you enter the loop: 0 + 1 = 1 1 + 2 = 3 3 + 3 = 6 And here you are ! res = 6 'i' doesn't take the value 4 because 'range' is exclusive
26th Jan 2017, 2:16 AM
Adrien