gs gs109 Python Lists - Python Lists - Quiz No.7
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?
a=[1,2,3] b=a.append(4) print(a) print(b)
[1,2,3,4] [1,2,3,4]
[1, 2, 3, 4] None
Syntax error
[1,2,3] [1,2,3,4]
Question 3: What will be the output of the following Python code?
a=[13,56,17] a.append([87]) a.extend([45,67]) print(a)
[13, 56, 17, [87], 45, 67]
[13, 56, 17, 87, 45, 67]
[13, 56, 17, 87,[ 45, 67]]
[13, 56, 17, [87], [45, 67]]
Question 4: What is the output of the following piece of code?
a=list((45,)*4) print((45)*4) print(a)
180 [(45),(45),(45),(45)]
(45,45,45,45) [45,45,45,45]
180 [45,45,45,45]
Syntax error
Question 5: What will be the output of the following Python code?
lst=[[1,2],[3,4]] print(sum(lst,[]))
[[3],[7]]
[1,2,3,4]
Error
[10]
Question 6: What will be the output of the following Python code?
word1="Apple" word2="Apple" list1=[1,2,3] list2=[1,2,3] print(word1 is word2) print(list1 is list2)
True True
False True
False False
True False
Question 8: What will be the output of the following Python code?
places = ['Bangalore', 'Mumbai', 'Delhi'] <br class="blank" />places1 = places places2 = places[:] <br class="blank" />places1[1]="Pune" places2[2]="Hyderabad" print(places)
[‘Bangalore’, ‘Pune’, ‘Hyderabad’]
[‘Bangalore’, ‘Pune’, ‘Delhi’]
[‘Bangalore’, ‘Mumbai’, ‘Delhi’]
[‘Bangalore’, ‘Mumbai’, ‘Hyderabad’]
Question 9: What will be the output of the following Python code?
x=[[1],[2]] print(" ".join(list(map(str,x))))
[1] [2]
[49] [50]
Syntax error
[[1]] [[2]]