Python and variables

Why can python have two of the same name variable but produce different outcomes?

For example:

message_string = “Hello there”

message_string = “Hasta la vista”

Each time we define the variable, we give it a different value. That is perfectly normal in programming. We have variables for that exact reason. They are only labels, remember.

1 Like