Course Solutions Uncategorized (Solved) : Code 1 2 3 4 5 6 Print Print Output Got 1 2 3 4 5 6 Inside Loop Changed List 4 5 6 Think Q29804764 . . . .

(Solved) : Code 1 2 3 4 5 6 Print Print Output Got 1 2 3 4 5 6 Inside Loop Changed List 4 5 6 Think Q29804764 . . . .

 

For the code:
==============================
a = [1,2,3]
for i in a:
a = [4,5,6]
print(i)
print(a)
==============================
The output I got is
=====================
1
2
3
[4, 5, 6]
=====================
but inside the loop, I changed the list a to [4,5,6]. I think theelement i should change too because i is the element in the list a.But the integer “i” did not change, even if the list change.

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Rich Onsidered En Printed Mes Er Main Practice Skills 4 16 Message Analysis Outlining Cont Q31002499(Answered) : Rich Onsidered En Printed Mes Er Main Practice Skills 4 16 Message Analysis Outlining Cont Q31002499

<br/><img src="https://media.cheggcdn.com/media%2Ff1c%2Ff1caa0db-6259-4d04-bae2-a2063fdbd0e6%2Fimage" alt="a rich onsidered en, printed mes- er from its main Practice Your Skills 4-16. Message for Analysis: Outlining Your Content [Lo. A writer is working on an insurance