Q. 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 = [10, 12, 26, 32, 65, 80]

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

III = nothing, because there is not any print statement

IV = nothing, because there is not any print statement


5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post