Report Bug
Qus :

What will be the output of the following Python code?

d = {0, 1, 2}
for x in d:
    print(x)

Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

d = {0, 1, 2}
for x in d:
    print(x)


A. 0 1 2
B. {0, 1, 2} {0, 1, 2} {0, 1, 2}
C. error
D. none of the mentioned


Solution
A. 0 1 2



Explanation
Loops over the elements of the set and prints them.



Report Bug