Jul-20-2023, 10:01 PM
(This post was last modified: Jul-20-2023, 10:01 PM by deanhystad.)
The difference is Pedroski55 is not calling int() after using the addition or exponentiation operators. int(float) throws away the fractional part of the float and returns the remaining value as an int object. int(1.2) == 1. int(-1.2) == -1.
Using a list only changed the structure of the code, not the results.
Using a list only changed the structure of the code, not the results.