List in Python Quiz 2 Share with others Enter details and click on Next Name Email School Name Q11. Write the output of the following code : >>>L=["Amit","Sumit","Naina"]>>>print(L[-1][-1]) [Naina] [a] a None Q12. Write the output of the following code : L=["Amit","Sumit","Naina"]print(L[1:-1]) ['Sumit'] [a] [Naina] None Q13. Write the output of the following code : L=["Amit","Sumit","Naina"]print(L*2) ['Amit', 'Sumit', 'Naina', 'Amit', 'Sumit', 'Naina'] ["Amit" , "Sumit" , "Naina"] Error None Q14. Write the output of the following code : L=["Amit","Sumit","Naina"]print(L**2) Error ["Amit" , "Sumit" , "Naina"]["Amit" , "Sumit" , "Naina"] None Q15. Write the output of the following code : L=[0.5 * x for x in range(4)]print(L) [0.0, 0.5, 1.0, 1.5] (0,.5, 1,1.5) [0.0, 0.5, 1.0, 1.5, 2.0] Error None Q16. Write the output of the following code : L=['a' * x for x in range(4)]print(L) [' ' , 'a' , 'aa' , 'aaa'] ['a', 'aa', 'aaa'] Error None Q17. Write the output of the following code : L= [1*x for x in range(10,1,-4)]print(L) [10, 6, 2] [10, 7, 4] Error None Q18. Write the output of the following code : L=[1,2,3,4,5]for i in L:Â Â Â print(i,end=" ")Â Â Â i=i+1 1, 2, 3, 4, 5 1, 3, 5 Error None Q19. Write the output of the following code : L=["Amit","Sumit","Naina"]L1=["Sunil"]print(L + L1) ['Amit' , 'Sumit' , 'Naina' , 'Sunil'] ['Amit' , 'Sumit' , 'Naina' , ['Sunil']] List can not concatenate None Q20. Which command is used to add an element in List? L1.add(4) L1.append(4) L1.new(5) None Time's upTime is Up! Related Share with others 3 thoughts on “List in Python Quiz 2” very nice Reply Thank you so much Ruby. Reply Very helpful. Thanks Reply Leave a ReplyCancel reply
very nice
Thank you so much Ruby.
Very helpful. Thanks