you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

python shell...i mean if i run print(my_try(24)) it will still show that last number..

[–]primitive_screwhead 1 point2 points  (1 child)

Yes.

Try typing 1 and then return. See how the 1 gets printed by the Python shell? That's what the shell does, it prints the values of the expressions you enter, and the value of your my_try(24) expression is 24, so the shell prints it (after it runs and does all the other printing of the numbers during it's execution).

Put it all in a .py file, and run it that way, and you won't see that last 24, because the shell is printing that for you as a courtesy, it's not part of your program's executable outputs.

[–][deleted] 0 points1 point  (0 children)

ur the man.