80. What will be printed when the following code is executed?
Anonymous Quiz
28%
error
41%
['cucumbers', 'bananas', 'lemons', 'pineapples']
8%
[400, 333, 98, 45]
23%
{'bananas': 333, 'pineapples': 45, 'lemons': 98, 'cucumbers': 400}
WEAKLY PYTHON MILLIONAIRE DIGEST 10.10-16.10.2022
~ Topic #6 “Unordered data types”
~ Average accuracy 41%
~ Average involvement 45 people (16%)
N.B.
🐍 The set() function will return a set of elements in a random order without duplicates
🐍Pay attention to the type of the element that is required in the result (e.g. many people choose the correct result, but in numbers instead of strings)
🐍 If you change the list, the link to which is part of some dictionary, the dictionary itself will change (e.g. l = [1], dict = {a:l} or {a:[1]}, then we change l = [2], so now dict = {a:[2]})
~ Topic #6 “Unordered data types”
~ Average accuracy 41%
~ Average involvement 45 people (16%)
N.B.
🐍 The set() function will return a set of elements in a random order without duplicates
🐍Pay attention to the type of the element that is required in the result (e.g. many people choose the correct result, but in numbers instead of strings)
🐍 If you change the list, the link to which is part of some dictionary, the dictionary itself will change (e.g. l = [1], dict = {a:l} or {a:[1]}, then we change l = [2], so now dict = {a:[2]})
81. What will be printed when the following code is executed?
Anonymous Quiz
41%
['Hawkeye', 'Thor', 'Falcon'], ['Iron Man', 'Captain America', 'Black Widow', 'The Hulk']
32%
['Hawkeye', 'Thor', 'Falcon'] ['Iron Man', 'Captain America', 'Black Widow', 'The Hulk']
24%
SyntaxError
3%
infinite loop
82. What will be printed when the following code is executed?
Anonymous Quiz
35%
['Hawkeye', 'Thor', 'Falcon'], ['Iron Man', 'Captain America', 'Black Widow', 'The Hulk']
47%
['Hawkeye', 'Thor', 'Falcon'] ['Iron Man', 'Captain America', 'Black Widow', 'The Hulk']
17%
SyntaxError
1%
infinite loop
83. What will be printed when the following code is executed?
Anonymous Quiz
4%
4
48%
ok
29%
error
20%
need another number
84. What will be printed when the following code is executed?
Anonymous Quiz
9%
V 0 3 VW 1 2 WV 2 1 W
77%
V 0 3 V 1 2 V 2 1 W
10%
error
5%
infinite loop
85. What will be printed when the following code is executed?
Anonymous Quiz
67%
[2, 4, 5, 6, 7, 8, 9, 10]
8%
[2, 4, 5, 6, 7, 8, 9]
15%
TypeError
11%
[2, 4, 6, 8, 10]
86. What will be the last line of the output?
Anonymous Quiz
30%
The capital of Norway is Paris
14%
The capital of France is Oslo
32%
TypeError
24%
The capital of Norway is Oslo
87. What will be printed when the following code is executed?
Anonymous Quiz
27%
IndentationError
44%
infinite loop
14%
1@3@7@15@31@63@
14%
1@3@7@15@31@63@127@255@511
WEAKLY PYTHON MILLIONAIRE DIGEST 17.10-23.10.2022
~ Topic #7 “Topics Recap”
~ Average accuracy 38%
~ Average involvement 33 people (12%)
N.B.
🐍 Be very careful while writing or reading the code - even minor mistakes can stop the program (e.g. missing parentheses, “=“ instead of “==“ and vice versa)
🐍Keep in mind that sometimes it is necessary to convert elements’ type in order to execute an operation (e.g. it is impossible to use len() with integer type)
🐍 Use **kwargs when you want to pass a variable number keyword arguments (keys and values)
🐍Pay attention to defining conditions in “while” loop: it may become an infinite loop if the while condition never becomes false (e.g. while True: … ; while range(x,y): … ; etc.)
~ Topic #7 “Topics Recap”
~ Average accuracy 38%
~ Average involvement 33 people (12%)
N.B.
🐍 Be very careful while writing or reading the code - even minor mistakes can stop the program (e.g. missing parentheses, “=“ instead of “==“ and vice versa)
🐍Keep in mind that sometimes it is necessary to convert elements’ type in order to execute an operation (e.g. it is impossible to use len() with integer type)
🐍 Use **kwargs when you want to pass a variable number keyword arguments (keys and values)
🐍Pay attention to defining conditions in “while” loop: it may become an infinite loop if the while condition never becomes false (e.g. while True: … ; while range(x,y): … ; etc.)
88. What will be printed when the following code is executed?
Anonymous Quiz
81%
t
12%
i
3%
h
4%
error