Please expalain this

https://www.codecademy.com/paths/analyze-data-with-python/tracks/ida-2-introduction-to-python/modules/ida-2-1-python-syntax/quizzes/python-hello-world-quiz

The number is multiplied but nothing is done with result → the variable is not updated

so the answer is 42 ( The Answer to the Ultimate Question of Life, the Universe, and Everything is 42 )

2 Likes

But, In programming we move line by line and then the answer should be 210 as in the second line variable is multiplied to 5.

Yes, the multiplication happens, but this line:

cool_number * 5

does not update the variable, if that line was:

cool_number = cool_number * 5

then yes, the answer would be 210.

The question uses this “misdirect” on purpose I think

2 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.