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 #127
a = 1
b = 1
print(a is b)
As 1 is non mutable, Python does not create a new memory address for it. As both a and b refer to 1 , they both have the same id (the id of 1 ) and as a result, they are considered as the same object by Python. (towardsdatascience.com/assignment-shallow-or-deep-a-story...)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) December 2, 2020
a = 1
b = 1
print(a is b)
False
True#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: