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?
Question 2: The output of the command below is:
print "Hello World"[::-1]
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]
Question 4: Where is not the standard data type in Python?
Question 5: Where is the value of colors [2]?
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
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))
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', 'bbb']
['a', 'aa', 'aaa', 'b', 'bb']
Question 9: Which printout does the print job output for the program below?
list1 = [1, 3] list2 = list1 list1[0] = 4 print(list2)
Question 10: Run the following code in Python, the result is:
LoạiError: không thể được phân tách từ không-số của kiểu 'str'