0
Spam =3 eggs=4 del spam spam =8 eggs=5 print(spam*eggs) = 32 right? Why ans is 40? When i just deleted spam not eggs?
3 ответов
+ 2
You will get more and better answers if u hack the code in and link it in your post.
This time Jay Matthews did it for u.
0
When you reassign the code for eggs it takes the value 5 the latter one, so 8*5= 40
0
You are creating 'Spam' and assigning 3. You are creating 'eggs' and assigning 4. You then delete 'spam' which does not exist (case sensitive variables). You are then creating 'spam' and assigning 8. Then overwriting the value of eggs for 5. So replacing variables with values you get 'print(8*5).