Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
-vim-31257yWait you mean
2 \n 1
is the output?
Then it is simple:
1.Prints ‘2’
OUTPUT:2
2.Calls A’s ‘spam()’:
1.Prints ‘1’
OUTPUT:1
So, final I output:
2
1 -
sonrisa14437yYou are calling print(2) earlier than the spam function of A, you should switch them if you want them in the correct order.
Related Rants
Can someone please tell me why output are 2 ?
1
Not 1
2
question
python3