Report Bug

Qus

What is the output?

s = "Python"
print(s[-1:-4])
Qus

निम्न code का output क्या होगा?

s = "Python"
print(s[-1:-4])


A. hon
B. hon in reverse
C. IndexError
D. Empty string


Solution
D. Empty string



Explanation
With the default positive step, the slice cannot move from -1 backward to -4. <br><br>Default step positive है, इसलिए -1 से -4 की ओर backward slicing नहीं होती और empty string मिलता है।
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad