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!
Question #270
my_set = {1, 2, 3, 4}
my_set.append(5)
print(my_set)
It will throw an AttributeError error. Sets don't implement neither append() nor extend() methods. (realpython.com/python-sets)
What it the output of the code snippet below?
— The Python Quiz (@thepythonquiz) September 18, 2020
my_set = {1, 2, 3, 4}
my_set.append(5)
print(my_set)
{1, 2, 3, 4, [5]}
{1, 2, 3, 4, 5}
It will throw a AttributeError error.#python #python3 #pythonprogramming #learnpython
Question difficulty: 🔵🔵🔵🔵🔵
Similar questions: