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 मिलता है।



Report Bug