Tag: halloween
-
Python Questions and Answers – Lists – 7
Python Code Output Questions Python Multiple Choice Questions & Answers (MCQs) focuses on “Lists-7”. Q 1.What will be the output of the following Python code? a=[“Apple”,”Ball”,”Cobra”] a.sort(key=len) print(a) A. Invalid syntax for sort() B. [‘Ball’, ‘Apple’, ‘Cobra’] C.[‘Apple’, ‘Ball’, ‘Cobra’] D.[‘Cobra’, ‘Apple’, ‘Ball’] Show Answer Answer:-B.[‘Ball’, ‘Apple’, ‘Cobra’] Explanation The syntax isn’t invalid and the…