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
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())
What will this code do?
def f(a: int = float) -> bool:
return str
print(f())
What will this code do?
f = lambda x: print(*x, sep=' ' , end=' ')
t = f(['a', 'b', 'c'])
What will this code do?
def f(a: int = 7) -> int:
return 2 + int(a)
print(f(3.5))
What will this code do?
list(map(pow, [1, 2, 3], [2, 3, 4]))
What will this code do?
def f(x: 1 = 1):
f.__annotations__["x"] += x
return f.__annotations__["x"]
print(f(), f(), f(10))
The function is given
def f(x: int = 1):
if type(x) is not f.__annotations__["x"]:
raise TypeError("Incorrect argument type x!")
f.__annotations__["x"] = float
return x**2
What will this code do?
def f(x): 
return x + 2
list(map(f, [1, 2, 3, 4])) == [f(x) for x in [1, 2, 3, 4]]