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?
import random
random.random() < random.randint(1, 10)
What will this code do?
(0 or 8 != 11 or 0) + (0 and 8 != 11 and 0)
What will this code do?
class counter:
def __init__(self, func):
self.calls = 0
self.func = func

def __call__(self, *args):
self.calls += 1
return self.func(*args), self.calls

@counter
def square(a):
return a ** 2

print(square(2)[0] + square(3)[0] + square(4)[1])
Choose your answer
Anonymous Quiz
8%
3
8%
6
17%
15
33%
16
25%
29
8%
See solution
What will this code do?
5 >> 1 << 1
Choose your answer
Anonymous Quiz
20%
0
35%
1
20%
4
15%
5
0%
511
10%
See solution
What will this code do?
class A: pass
class B:
def __init__(self):
x = super()
print(x is A, x is B)

b = B()
What will this code do?
def f(*, name):
print(len(name), end=" ")

try:
f(name="vasya")
f("sergey")
except:
f(name="oleg")
What will this code do?
sum(divmod(16,5), 5)
Choose your answer
Anonymous Quiz
11%
4
17%
5
17%
8
28%
9
11%
26
17%
See solution
What will this code do?
def f(x, y):
return x ** y
print(f.__call__(3, 2) + f(2, 3))
What will this code do?
"{0:b}{1:#o}".format(3, 8)
How to print out a list of already installed python libraries?
Anonymous Quiz
20%
pip show
0%
pip search
0%
pip check
60%
pip list
0%
pip completion
8%
pip cache
12%
See solution