s = "apple"

for i in range(len(s)):
if i == len(s) - 1:
print(s[i], "- No next character")
else:
print(s[i], "-", s[i+1])

What is the output of the following program

Posted on by