Question #200

What is the output of the code snippet below?
x = 1
y = 2
z = 3
if 1 in (x, y, z):
    print(True)
else:
    print(False)

It will be True! This syntax is a convenient way to check if at least one value across variables is an object. (geeksforgeeks.org/python-in-keyword)


Comment on Disqus:

Question difficulty: ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต


Similar questions: