Computer Science, asked by uiui9739, 9 months ago

What is the output produced by the following code snippet? List1 = [5,6,7,8,9,10,11,12,13,14] print(List1[::4])

Answers

Answered by queensp73
0

Answer:

THIS IS THE OUTPUT :

[5, 9, 13]

Explanation:

hope it helps u

QUEEN SP's ANSWER !!

:)

Answered by poojan
21

[5, 9, 13] is the output.

Explanation:

  • List1 = [5,6,7,8,9,10,11,12,13,14] is the given list that consists numbers ranging from 5 to 14 numbers within it (bounds included).

  • list[::4] takes out the list of values with an slice difference of 4 between successors, starting from index 0, then 0+4 = 4, 4+4=8 and so on. So, it results List1[::4] = [5, 9, 13]

  • So, once the interpreter triggers the statement print(List1[::4]), we get [5, 9, 13] as output.

Learn more:

1) List = [1,2,3,4,5,6,7,8,9,10] l = sum(list[::2]) print(l)

https://brainly.in/question/16871694

2) Indentation is must in python. Know more about it at :

brainly.in/question/17731168

Similar questions