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
   64   65   66   67   68   69   70   71   72   73   74