Computer Science, asked by GrimReaper7326, 1 year ago

If the list t = [2, 5, 7, 9, 10, 11, 12], what will be the output of the statement t[2:4]?


piyush7570: [7,9] is output

Answers

Answered by piyush7570
0

[7,9] is the output

Answered by sailorking
1

Answer:

According to the question the output of the following program statement will be "7 and 9". The reason for the answer is because in python, when there is use of list, then the content of the list can be printed, by providing the index of the positions.

Explanation:

When a particular set of data of the list is to be printed, at that moment there are two things required along with the name of the list, the starting index and the last index +1 position. in this way a set of characters can be printed easily.

Similar questions