Python & ML tasks
414 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?
a = {1: "London", 3: "Berlin"}
b = {2: "New York", 3: "Moscow", 4: "Geneva"}

c = {**a, **b}
print(c)
What will this code do?
import numpy as np
matrix_a = np.array([
[1, 1, 1],
[1, 1, 1],
[1, 1, 2]
])
matrix_b = np.array([
[1, 3, 1],
[1, 3, 1],
[1, 3, 8]
])
с = matrix_a + matrix_b
print(с)
What will this code do?
c = map(lambda x: x + x, filter(lambda x: x>3, (1, 2, 3, 4)))
print(list(c))
What will this code do?
import numpy as np
a = np.array([1, 2, 3])
print(np.dot(a, a.T))
What will this code do?
c = filter(lambda x: x>=3, map(lambda x: x+x, (1, 2, 3, 4)))
print(list(c))
What will this code do?
def unpacking(x, y, z):
print(x, y, z, end=" ")
tuple_vec = (1, 0, 1)
dict_vec = {'x': 1, 'y': 0, 'z': 1}
unpacking(*tuple_vec)
unpacking(**dict_vec)
What will this code do?
7//3 + 7//-3
Choose your answer
Anonymous Quiz
6%
2
9%
1
62%
0
13%
-1
5%
2
5%
See solution
😱6
What will this code do?
class B:
def __init__(self):
self.arr = []
def __getattr__(self, attrname):
return getattr(self.arr, attrname)

b = B()
b.append(1)
b.append(2)
b.append(3)
b.pop()
print(b.arr)
What will this code do?
",".join(['1', '2', '3', '4'])
What will this code do?
print(type(type(bool(1))))