Multiple choice quiz about Python - Part 4
Continue Python's thematic quiz, Part 4 goes back to the topic Core Data Type - Standard data types in Python. Let's try with Quantrimang to try the 10 questions below.
-
Question 1: What kind of data is the object below?
L = [1, 23, 'hello', 1]-
List
-
Dictionary
-
Tuple
-
Array
-
-
Question 2: The output of the command below is:
print "Hello World"[::-1]-
dlroW olleH
-
Hello Worl
-
d
-
Lỗi
-
-
Question 3: Which result is the output of the code below?
list = [ 'Tech', 404, 3.03, 'Beamers', 33.3 ]
print list[1:3]-
['Tech', 404, 3.03, 'Beamers', 33.3]
-
[404, 3.03]
-
['Tech', 'Beamers']
-
None of the above
-
-
Question 4: Where is not the standard data type in Python?
-
List
-
Dictionary
-
Class
-
Tuple
-
-
Question 5: Where is the value of colors [2]?
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']-
orange
-
indigo
-
blue
-
yellow
-
-
Question 6: What is the difference between tuple and list?
-
Tuple in curly braces, list in square brackets oil.
-
Tuple in square brackets, list in curly brackets.
-
Tuple is a list with roman data, the list is a list with a normal data type.
-
Data of type list can be changed, data of tuple type cannot be changed.
-
-
Question 7: What is the output of the code below?
mylist=[1, 5, 9, int('0')]
print(sum(mylist))-
16
-
15
-
63
-
There is no right answer.
-
-
Question 8: The results of the printed program are:
mylist=['a', 'aa', 'aaa', 'b', 'bb', 'bbb']
print(mylist[:-1])-
[a, aa, aaa, b, bb]
-
['a', 'aa', 'aaa', 'b', 'bb', 'bbb']
-
['a', 'aa', 'aaa', 'b', 'bb']
-
Lỗi
-
-
Question 9: Which printout does the print job output for the program below?
list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)-
[4, 3]
-
[1, 3]
-
[1, 4]
-
[1, 3, 4]
-
-
Question 10: Run the following code in Python, the result is:
num = '5'*'5'-
333
-
27
-
9
-
LoạiError: không thể được phân tách từ không-số của kiểu 'str'
-
Was this article helpful?
Your feedback helps us improve.
Reader Comments 0
Sign in with email or Google to join the discussion.