98. What will be printed when the following code is executed?
Anonymous Quiz
8%
{'v', 'E', 'y', 'r', 'e'}
9%
{' but not every man really lives.', 'Every man dies'}
69%
{'Every', 'not', 'lives.', 'man', 'but', 'really', 'every', 'dies,'}
14%
TypeError
99. What will be printed when the following code is executed?
Anonymous Quiz
36%
KeyError
54%
['December', 'February', 'January']
9%
['summer', 'winter']
1%
['August', 'July', 'June']
100. What will be printed when the following code is executed?
Anonymous Quiz
19%
KeyError
65%
['December', 'February', 'January']
5%
['summer', 'winter']
11%
['August', 'July', 'June']
101. What will be printed when the following code is executed?
Anonymous Quiz
63%
['d', 'e', 'r']
22%
['1', 'c', 'k', 'o', 's', 's']
5%
[0,0,0,1]
11%
['-', 'h', 'i', 'r', 's', 't', 't']
WEAKLY PYTHON MILLIONAIRE DIGEST 31.10-6.11.2022
~ Topic #9 “Nested data structures. Sorting”
~ Average accuracy 54%
~ Average involvement 29 people (10%)
N.B.
🐍 Remember the general rules of sorting: numbers are sorted in either ascending or descending order (according to the attribute specified); strings are sorted in alphabetical order, latin letters first, then cyrillic; first uppercase, then lowercase. Numbers in form of a string are sorted according to their codes (e.g. 11 comes after 2 when being sorted in ascending order, but “11” comes before “2”, while sorting as string type)
🐍 Be careful when referring to the keys in the dictionary. Square brackets in the dictionary call a specific element that is already in the dictionary, not an element by its index. For example, if we want to access the first element in a = {1:”one”, 2:”two”} by typing a[0], KeyError will occur: we tried to access a “0” key in a dictionary that doesn’t contain it
~ Topic #9 “Nested data structures. Sorting”
~ Average accuracy 54%
~ Average involvement 29 people (10%)
N.B.
🐍 Remember the general rules of sorting: numbers are sorted in either ascending or descending order (according to the attribute specified); strings are sorted in alphabetical order, latin letters first, then cyrillic; first uppercase, then lowercase. Numbers in form of a string are sorted according to their codes (e.g. 11 comes after 2 when being sorted in ascending order, but “11” comes before “2”, while sorting as string type)
🐍 Be careful when referring to the keys in the dictionary. Square brackets in the dictionary call a specific element that is already in the dictionary, not an element by its index. For example, if we want to access the first element in a = {1:”one”, 2:”two”} by typing a[0], KeyError will occur: we tried to access a “0” key in a dictionary that doesn’t contain it
102. What will be printed when the following code is executed?
Anonymous Quiz
17%
Error
48%
True
34%
False
1%
"false"
103. What will be printed when the following code is executed?
Anonymous Quiz
31%
NameError
20%
42
20%
55
30%
infinite loop
104. What will be printed when the following code is executed?
Anonymous Quiz
19%
5
67%
5.0
10%
4.75
3%
4.5
105. What will be printed when the following code is executed?
Anonymous Quiz
38%
error
17%
[“11”, “44”, “99”]
6%
[1, 2, 3]
38%
[1, 16, 81]
106. What will be printed when the following code is executed?
Anonymous Quiz
5%
3
52%
[“hehe”]
24%
“hehe”
19%
“hello”