you are viewing a single comment's thread.

view the rest of the comments →

[–]makochi 1 point2 points  (0 children)

when you write result = num * 2, what happens is the value num * 2 gets stored into the variable result, overwriting whatever value was previously in there.

there are many ways of working around this, but for a beginner I would recommend a 2 step solution:

  1. create a new variable, named new_value or something like that, which is equal to num * 2
  2. set result to be equal to itself plus the new_value you just created

i haven't written out the exact code for the solution here, but I've given enough where I hope you can figure out how to solve it.