Page 69 - PYTHON-12
P. 69
if newlist[i]!=newlist[ed]:
print ("Given String is not a palindrome")
break
if i>=ed:
print ("Given String is a palindrome")
break
l=l-1
ed = ed - 1
Program 7: Write a Program to show the outputs based on entered list.
Solution:
my_list = ['p','r','o','b','e']
# Output: p
print(my_list[0])
# Output: o
print(my_list[2])
# Output: e
print(my_list[4])
# Error! Only integer can be used for indexing