🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

वर्गों का आउटपुट क्या होगा = {x: x*x for x in range(6)}

What will be the output of squares = {x: x*x for x in range(6)}

A
[0, 1, 4, 9, 16, 25]
B
[0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25]
C
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
D
Error
Explanation

The code creates a dictionary where each key is a number from 0 to 5, and the value is its square.

So, the output is:

{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}

The correct answer is (C).

Correct Answer: C) {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}

Latest Updates