Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 3 : ESA / ESA

Advertisement

Detailed Solution

सही उत्तर ESA / ESA है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

What is the output of the following Python code involving string slicing with a step? / स्टेप सहित स्ट्रिंग स्लाइसिंग वाले निम्नलिखित Python कोड का आउटपुट क्या होगा? s = "PREPSNAP" print(s[2:7:2])

1.
EPS / EPS
2.
ESN / ESN
3.
ESA / ESA
4.
EPN / EPN

Correct Answer: ESA / ESA

The characters at indices 2, 4 and 6 of "PREPSNAP" are E, S and A, giving "ESA". / "PREPSNAP" के सूचकांक 2, 4 और 6 पर E, S और A हैं, अतः "ESA" मिलता है।

Downloaded from PrepSnap (prepsnap.in)