WEAKLY PYTHON MILLIONAIRE DIGEST 12-18.09.2022
~ Topic #2 “Boolean data type and conditional operator”
~ Average accuracy 67%
~ Average involvement 80 people (33%)
N.B.
🐍 If you want to specify multiple conditions (using AND or OR), you should specify the variable to which the condition applies in each case (e.g. “if (a > 1) and (a % 2 == 0) …”)
🐍It is possible to use boolean data type to specify a condition (e.g. “if True…”)
🐍 An empty variable (string, list, etc.) counts as False, all other variables count as True
~ Topic #2 “Boolean data type and conditional operator”
~ Average accuracy 67%
~ Average involvement 80 people (33%)
N.B.
🐍 If you want to specify multiple conditions (using AND or OR), you should specify the variable to which the condition applies in each case (e.g. “if (a > 1) and (a % 2 == 0) …”)
🐍It is possible to use boolean data type to specify a condition (e.g. “if True…”)
🐍 An empty variable (string, list, etc.) counts as False, all other variables count as True
53. What will the program output after sequential input "5", "6", "7", "break" without quotes?
Anonymous Quiz
10%
"567"
10%
4
36%
infinite loop
45%
3
54. What will be printed when the following code is executed?
Anonymous Quiz
24%
infinite loop
61%
40
9%
25
6%
30
55. What series of numbers will this program output?
Anonymous Quiz
5%
4 7 10
7%
4 5 6 7 8 9 10 11 12 13 14
85%
4 7 10 13
2%
error
56. What will be printed when the following code is executed?
Anonymous Quiz
22%
10
16%
infinite loop
46%
11
17%
error
57. What will be printed when the following code is executed?
Anonymous Quiz
76%
1 2 3 4
10%
IndentationError
6%
infinite loop
8%
1 2 3 4 break
58. What will be printed when the following code is executed?
Anonymous Quiz
4%
Hello 4
88%
hello hello hello hello
7%
TypeError
1%
infinite loop
WEAKLY PYTHON MILLIONAIRE DIGEST 19-25.09.2022
~ Topic #3 “While Loop”
~ Average accuracy 60%
~ Average involvement 63 people (25%)
N.B.
🐍 The “while” loop will continue to run until the specified condition is satisfied (e.g. “while x != 3…” means if x = 3, the code stops running)
🐍 “Print” function inside the loop prints every value it takes
🐍 The “break” statement immediately terminates a loop
~ Topic #3 “While Loop”
~ Average accuracy 60%
~ Average involvement 63 people (25%)
N.B.
🐍 The “while” loop will continue to run until the specified condition is satisfied (e.g. “while x != 3…” means if x = 3, the code stops running)
🐍 “Print” function inside the loop prints every value it takes
🐍 The “break” statement immediately terminates a loop
60. What will be printed when the following code is executed?
Anonymous Quiz
50%
15
18%
IndexError
28%
12345
4%
"12345"
61. What will be printed when the following code is executed?
Anonymous Quiz
15%
['or', 'I', 'go?']
19%
['Should', 'stay', 'should']
65%
['stay', 'should']
2%
['or', 'I']