gs gs109 Python Lists - Python Lists - Quiz No.5
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Lists. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What will be the output of the following Python code?
>>>m = [[x, x + 1, x + 2] for x in range(0, 3)]
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2, 1, 2, 3, 2, 3, 4]
Question 5: What will be the output of the following Python code?
values = [[3, 4, 5, 1 ], [33, 6, 1, 2]] for row in values: row.sort() for element in row: print(element, end = " ") print()
The program prints two rows 3 4 5 1 followed by 33 6 1 2
The program prints on row 3 4 5 1 33 6 1 2
The program prints two rows 3 4 5 1 followed by 33 6 1 2
The program prints two rows 1 3 4 5 followed by 1 2 6 33
Question 10: What will be the output of the following Python code?
points = [[1, 2], [3, 1.5], [0.5, 0.5]] points.sort() print(points)
[[1, 2], [3, 1.5], [0.5, 0.5]]
[[3, 1.5], [1, 2], [0.5, 0.5]]
[[0.5, 0.5], [1, 2], [3, 1.5]]
[[0.5, 0.5], [3, 1.5], [1, 2]]