Question:

What does this expression print?

my_name = "50 Cent"
my_name = "Miley"
p my_name

 

Answer:

"Miley"

The my_name variable was assigned to the value "50 Cent", but then it was reassigned to the value "Miley". Once the my_name variable is reassigned to "Miley", it loses all knowledge that it used to point to "50 Cent".


Keywords:

© 2017 QuizBucket.org