gs gs109 Python Lists - Python Lists - Quiz No.1
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: Which of the following commands will create a list?
list1 = list()
list1 = []
list1 = list([1, 2, 3])
all of the mentioned
Question 2: What is the output when we execute list(“hello”)?
[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
[‘hello’]
[‘llo’]
[‘olleh’]
Question 4: Suppose list1 is [2445,133,12454,123], what is max(list1)?
2445
133
12454
123
Question 7: To shuffle the list(say list1) what function do we use?
list1.shuffle()
shuffle(list1)
random.shuffle(list1)
random.shuffleList(list1)
Question 8: Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?
print(list1[2:])
print(list1[:2])
print(list1[:-2])
all of the mentioned
Question 10: Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
[2, 33, 222, 14]
Error
25
[25, 14, 222, 33, 2]