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

वह कौन सा व्यंजक है जो 'baz' में 'z' लौटाता है?

What is the expression that returns the 'z' in 'baz'?

x=[10, [3.141, 20, [30, 'baz', 2.718]]]
A)
B)
C)
D)

Explanation:

To access the 'z' in the string 'baz' from the given list:

 
x = [10, [3.141, 20, [30, 'baz', 2.718]]]

The string 'baz' is located in the third position of the nested list (inside x[1][2]), and you can access the character 'z' by indexing into the string:

 
x[1][2][1][2]

Here's the breakdown:

  • x[1] accesses the second element of the outer list: [3.141, 20, [30, 'baz', 2.718]].
  • x[1][2] accesses the third element of that list: [30, 'baz', 2.718].
  • x[1][2][1] accesses the second element of that inner list: 'baz'.
  • x[1][2][1][2] accesses the third character of the string 'baz', which is 'z'.

So, the correct expression is:

 
x[1][2][1][2]
Latest Updates