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 मिलता है।
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad