Choose the correct answer
Anonymous Quiz
14%
4
0%
6
64%
9
14%
27
7%
TypeError
0%
SyntaxError
0%
See solution
What will this code do?
def f(a: int = 2, b: int = 2) -> int:
return a ** b
print(f(3))
Choose the correct answer
Anonymous Quiz
0%
4
5%
6
65%
9
10%
27
5%
TypeError
10%
SyntaxError
5%
See solution
Which expression would be equivalent for a ternary operator
"B if a else с", considering that the variables b and c contains some objects, and the variable a - a boolean value.
"B if a else с", considering that the variables b and c contains some objects, and the variable a - a boolean value.
Anonymous Quiz
0%
a or b and c
10%
a and b and c
20%
a or b or c
25%
a or c and b
25%
a and b or с
5%
a and c or b
15%
See solution
What will this code do?
f = (lambda x, y: x if х < y else y)
z1 = f('b', 'а')
z2 = f('а', 'b')
print(z1 == z2)
What will this code do?
def f(a: int = 5, b: int = 3, c: int = 4) -> int:
return a + b + c
print(f(2.5, b=2))
Choose the correct answer
Anonymous Quiz
5%
int
5%
4.5
40%
8.5
15%
11
5%
12
25%
TypeError
0%
SyntaxError
5%
See solution
What will this code do?
import sys
f = lambda x: list(map(sys.stdout.write, x))
t = f(['1', '2', '3'])
Choose the correct answer
Anonymous Quiz
16%
[123]
0%
[321]
26%
123
32%
1 2 3
16%
321
0%
3 2 1
11%
See solution
What will this code do?
def f(a: int = '1', b: int = '2', c: int = '3') -> int:
return a + b + c
print(f())
Choose the correct answer
Anonymous Quiz
5%
1
5%
2
0%
3
43%
4
24%
TypeError
14%
SyntaxError
10%
See solution
What will this code do?
def f(a: int = float) -> bool:
return str
print(f())
Choose the correct answer
Anonymous Quiz
10%
<class 'int'>
10%
<class 'float'>
5%
<class 'bool'>
38%
<class 'str'>
19%
TypeError
19%
SyntaxError
0%
See solution
What will this code do?
f = lambda x: print(*x, sep=' ' , end=' ')
t = f(['a', 'b', 'c'])
Choose the correct answer
Anonymous Quiz
5%
c b a
5%
cba
55%
a b c
10%
abc
5%
a\nb\nc\n
10%
['a', 'b', 'c']
5%
TypeError
5%
SyntaxError
0%
See solution