WEAKLY PYTHON MILLIONAIRE DIGEST 24.10-30.10.2022
~ Topic #8 “Topics Recap”
~ Average accuracy 50%
~ Average involvement 44 people (16%)
N.B.
🐍 When comparing characters or strings, Python converts the characters to their corresponding ordinal values, and then compares from left to right. The unique value of the symbol can be found using the ord() function (e.g. print("apple" > "banana") gives False, while print("apple" < "banana") gives True)
🐍 Mind the data types when giving your answers. The / operator, when dividing an integer by an integer, returns a result of the float type. (e.g. 2/2 gives 1.0)
~ Topic #8 “Topics Recap”
~ Average accuracy 50%
~ Average involvement 44 people (16%)
N.B.
🐍 When comparing characters or strings, Python converts the characters to their corresponding ordinal values, and then compares from left to right. The unique value of the symbol can be found using the ord() function (e.g. print("apple" > "banana") gives False, while print("apple" < "banana") gives True)
🐍 Mind the data types when giving your answers. The / operator, when dividing an integer by an integer, returns a result of the float type. (e.g. 2/2 gives 1.0)
95. What will be printed when the following code is executed?
Anonymous Quiz
19%
April
70%
May
10%
4
1%
"4"
96. What will be printed when the following code is executed?
Anonymous Quiz
9%
[‘19’, ‘3’, ‘4’, ‘77’]
30%
[3, 4, 19, 77]
48%
341977
14%
193477
97. What will be printed when the following code is executed?
Anonymous Quiz
19%
['l', 'q''A', 'а', 'Ё', 'Е', 'Ф']
13%
TypeError
47%
['A', 'l', 'q', 'Ё', 'Е', 'Ф', 'а']
21%
['A', 'Ё', 'Е', 'Ф', 'l', 'q', 'а']
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