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

निम्न Python code का आउटपुट क्या होगा?

What will be the output of the following Python code?


for i in [1, 2, 3, 4][::-1]:
    print(i)
A
1,2,3,4
B
4,3,2,1
C
Error
D
4,3,2,1
Explanation

Code:

 
for i in [1, 2, 3, 4][::-1]: print(i)

✅ English:

  • [1, 2, 3, 4][::-1] means the list is reversed.

  • So the loop becomes: for i in [4, 3, 2, 1], and it prints each number on a new line.

✅ Hindi:

  • [1, 2, 3, 4][::-1] का मतलब है लिस्ट को उल्टा कर देना।

  • इसलिए loop चलता है: for i in [4, 3, 2, 1], और हर नंबर नई लाइन में print होता है।

Correct Answer: B) 4,3,2,1

Latest Updates