Computer Science, asked by jagdishsamant8117, 7 months ago

Give the elements of the following list which are present at the given index numbers: languages=['Hindi', 'English', 'Bengali', 'Oriya', 'Telugu', 'Marathi', 'Malayalam']

a) languages [2]

b) languages (-3]

c) languages [2:5]

d) languages [2:5:2]​

options

a)['English'], b)['Telugu'], c)['Hindi','English'], d)['Telugu','Marathi','Malayalam']

a)['English'], b)['Bengali'], c)['Bengali','Oriya','Telugu''], d)['Bengali', 'Oriya']

a)[English], b)['Telugu'], c)['Bengali', 'Oriya', 'Telugu'], d)['Bengali', 'Telugu']

a)['English'], b)['Hindi''], c)['Bengali','Oriya','Telugu''], d)['Bengali', 'Oriya']

Answers

Answered by sudhaviswam2404
0

don't know the answer so

Answered by dreamrob
0

Answer:

languages = ['Hindi', 'English', 'Bengali', 'Oriya', 'Telugu', 'Marathi', 'Malayalam']

                 ['Hindi', 'English', 'Bengali', 'Oriya', 'Telugu', 'Marathi', 'Malayalam']

Indexing:       0            1                2            3          4               5                6

Negative:     -7           -6              -5           -4         -3              -2               -1

a) languages [2]

Output: Bengali

b) languages [-3]

Output: Telugu

c) languages [2:5]

Start from index 2 and will go till index 4 (5 - 1)

Output: ['Bengali', 'Oriya', 'Telugu']

d) languages [2:5:2]

Start from index 2 and will go till index 4 (5 - 1) and giving alternate element.

Output: ['Bengali', 'Telugu']

Similar questions