The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
my_list = ["apple", "banana", "grapefruit"] id1 = id(my_list) my_list+= ["cherries"] id2 = id(my_list) print(id1 == id2)
Lists are mutable. As such, the += operator applied on a list doesn't return a new object. The list my_list is appended in place. (stackoverflow.com/questions/2347265/why-does-behave-unexp...)
Question difficulty: 🔵🔵🔵🔵🔵