Question

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

Option 2 : OPT

Advertisement

Detailed Solution

सही उत्तर OPT है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

What does the following Python string-slicing code output? / स्ट्रिंग स्लाइसिंग वाले निम्नलिखित Python कोड का आउटपुट क्या है? s = 'COMPUTER' print(s[1:7:2])

1.
OMPT
2.
OPT
3.
OPUE
4.
CMPTR

Correct Answer: OPT

Indices 1, 3, 5 of COMPUTER are O, P, T, giving 'OPT'. / COMPUTER के सूचकांक 1, 3, 5 पर O, P, T हैं, अतः 'OPT' मिलता है।

Downloaded from PrepSnap (prepsnap.in)