Python - Variables and Dynamic Typing
What will be the output of this code?
name = "Alice" age = 30 name = "Bob" print(name, age)
name = "Alice" age = 30 name = "Bob" print(name, age)
name is set to "Alice" and age to 30. Then name is reassigned to "Bob".name and age. Since name was changed to "Bob", and age remains 30, the output is "Bob 30".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions