Computer Science, asked by samalsai1346, 4 months ago

write a python program to input and access 2nd, 3rd, and 4th element using forward indexing method access 1st, 2nd and 5th element using backward indexing​

Answers

Answered by yesiamin6
1

Answer:

s=input()

print("entered string=",s)

l=len(s)

print("length of string is =",l)

print("2nd element from forward=",s[1])

print("3rd element from forward=",s[2])

print("4th element from forward=",s[3])

print("1st element from backward",s[l-1])

print("2nd element from backward",s[l-2])

print("5th element from backward",s[l-5])

Explanation:

HOPE IT HELPS YOU

DO FOLLOW FOR MORE ANSWERS/PROGRAMS

MARK AS BRAINLIEST

Attachments:
Similar questions