Page 70 - PYTHON-12
P. 70

# my_list[4.0]

               # Nested List


               n_list = ["Happy", [2,0,1,5]]

               # Nested indexing

               # Output: a

               print(n_list[0][1],n_list[0][2],n_list[0][3])

               # Output: 5


               print(n_list[1][3])
























               Program 8:  Write a Program to enter the numbers in a list using split () and to use all the functions
               related to list.

               Solution:


               #Program to enter the numbers in a list using split () and to use all the functions related to
               list.

               # numbers = [int(n, 10) for n in input().split(",")]


               # print (len(numbers))

                memo=[]

               for i in range (5):
   65   66   67   68   69   70   71   72   73   74   75