Computer Science, asked by artichy1987, 7 hours ago

Write the output of the following.
1.=MIN(5,7,8)
2.=LEFT ("computer",4)
3.=AVERAGE (12,3,6)
4.=TODAY 0​

Answers

Answered by panirajeeb3
4

Answer:

What will be the output of the following statements?

i) list1 = [12,32,65,26,80,10]

list1.sort()

print(list1)

ii) list1 = [12,32,65,26,80,10]

sorted(list1)

print(list1)

iii)list1 = [1,2,3,4,5,6,7,8,9,10]

list1[::-2]

list1[:3] + list1[3:]

iv)list1 = [1,2,3,4,5]

list1[len(list1)-1]

ANSWER:

i) The sort() method will sort the list in ascending order in place.

OUTPUT:

[10, 12, 26, 32, 65, 80]

ii) The sorted() function takes a list as a parameter and creates a new list consisting of the same elements arranged in sorted order. It doesn’t change the list which is passed as a parameter itself.

OUTPUT:

[12, 32, 65, 26, 80, 10]

iii) The statement in line 2 has a negative step size. This means that the list will be traversed in reversed order with step size 2.

OUTPUT: [10, 8, 6, 4, 2]

The statement in line 3 will print the complete list. i.e. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

iv) This will print the last element of the list. i.e. 5

list1[len(list1)-1]

list1[5-1]

list1[4]

5

Thanks

Answered by manojkumardixit0
1

Answer:

the output is 5 is sol is given above

hope that u like my ans

mark me as brainliest

Similar questions