logo CodeStepByStep logo


Language/Type: Python basics mystery variables

Rewrite the code from the previous exercise first_second to be shorter, by defining the variables on the same line and by using the special assignment operators (e.g., +=, -=, *=, and /=) as appropriate.

first = 8
second = 19
first = first + second
second = first - second
first = first - second
Bare code: Write a fragment of Python code as described, without any class or function/method heading around your code.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.