string = "hello world" print(string[5:10]) in python

main.py
string = "hello world"
print(string[5:10])
43 chars
3 lines

The code above will output " worl". It uses string slicing to extract a substring from the original string. The slicing operation string[5:10] starts at the 6th character (index 5, because Python indexes strings starting from 0) and ends at the 10th character (index 9), but does not include it in the resulting substring.

gistlibby LogSnag