Python Tasks & ML | Задачи по питону и машинному обучению
9.4K subscribers
27 photos
1 file
36 links
Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks

Questions — @dina_ladnyuk
Download Telegram
Что выведет код?
import time
my_time = time.strptime("Mon Feb 22 10:55:00 2021")
my_time = time.strftime("%d.%m.%Y", my_time)
print(my_time)
Что выведет код?
import time
time.asctime((2021, 2, 23, 12, 0, 0, 1, 0, 0))
Что выведет код?
def f(**x): 
return sum(x.values())
s = f(a=1, b=2) + f(x=2, y=1, z=0)
print(s)
Что выведет код?
x = (i**2 for i in range(1, 100) if not i % 3)
y = (i for i in x if not i % 5)
print(next(y))
Какую функцию стоит использовать для генерации криптографически надежных (псевдо)случайных элементов?
Anonymous Quiz
25%
os.urandom(1)
39%
random.random()
23%
random.uniform(0, 1)
3%
id(0)
11%
Посмотреть результаты
Что выведет код?
import hashlib
m = hashlib.sha256()
m.update(b"hello")
print(m.digest_size, len(m.hexdigest()))
Что выведет код?
import datetime
t1 = datetime.date(2021, 3, 5) - datetime.date(2021, 2, 23)
t2 = datetime.date(2020, 3, 5) - datetime.date(2020, 2, 23)
print((t2 - t1).days)
Какая библиотека позволяет отлавливать и генерировать события клика и движения мышки?
Anonymous Quiz
12%
mss
12%
pillow
12%
pytorch
33%
pynput
16%
watchdog
15%
Посмотреть результаты
Что выведет код?
class A:
def f(self):
print('A', end="")
class B:
def f(self):
print('B', end="")
class C(A):
def f(self):
print("C", end="")
super().f()
self.__class__.__bases__ = (B,)
x = C()
_ = x.f(), x.f()
Что выведет код?
class B:
def __init__(self) :
print ('В', end='')
super().__init__()
class C:
def __init__(self):
print('C', end='')
super().__init__ ()
class D(B, C):
def __init__(self):
print('D', end='')
B.__init__(self)
C.__init__(self)
X = D()
Что выведет код?
class A:
def f(self):
print("A", end="")
class B(A):
def f(self):
print("B", end="")
super().f()
A.f(self)
class C(A):
def f(self):
print("C", end="")
super().f()
A.f(self)
class D(B, C):
def f(self):
print("D", end="")
super().f()
d = D()
d.f()