Python & ML tasks
416 subscribers
2 photos
3 links
Python, functions, classes, iterators, generators, numpy, pandas, scikit-learn, TensorFlow
for advertising: @dina_ladnyuk

For advertising and donations in USD:
SWIFTBIC BUKBGB22
IBAN GB40 BUKB 2047 3453 2396 99
Mrs Dina Ladnyuk
Download Telegram
Choose the correct answer
Anonymous Quiz
17%
0
17%
1
42%
15
17%
12345
8%
None
0%
TypeError
What will this code do?
def f(L):
s = ''
items = list(L)
while items:
first = items.pop(0)
if isinstance(first, str):
s += first
else:
items[:0] = first
return s
print(f(('a', ('b', ('c', ('d', 'e'))))))
What will this code do?
def f(a: int = 2, b: int = 2) -> int:
return a ** b
print(f(3))
What will this code do?
def f(a: int = 2, b: int = 2) -> int:
return a ** b
print(f(3))
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.
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)
Choose the correct answer
Anonymous Quiz
5%
a
5%
b
60%
True
25%
False
0%
TypeError
5%
See solution
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))
What will this code do?
import sys
f = lambda x: list(map(sys.stdout.write, x))
t = f(['1', '2', '3'])
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
0%
int
5%
str
21%
6
58%
123
5%
TypeError
11%
SyntaxError
What will this code do?
((lambda x: (lambda y:  x ** y)) (3)) (2)
Choose the correct answer
Anonymous Quiz
6%
5
6%
6
44%
8
38%
9
6%
SyntaxError
What will this code do?
def f(a: 1 = 2) -> 3:
return 4
print(f())