text = "hello"
print(text[0])
print(text[1])output
h
eIndex:
h e l l o
0 1 2 3 4- negative indexing
text = "hello"
print(text[-1])
print(text[-2])output
o
lNegative Index:
h e l l o
-5 -4 -3 -2 -1text = "hello"
print(text[0])
print(text[1])output
h
eIndex:
h e l l o
0 1 2 3 4text = "hello"
print(text[-1])
print(text[-2])output
o
lNegative Index:
h e l l o
-5 -4 -3 -2 -1