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?

import numpy as np
a = np.array([[1, 2, 3], [4, 5, 6]])
print(a.reshape(1, -1))
What will this code do?

class A:
def __repr__(self):
return "repr"
def __str__(self):
return "str"
a = A()
print(a, repr(a), str(a))
What will this code do?
ord('5') - ord('2')
What will this code do?
ord('5') + ord('2') == 7
Choose your answer
Anonymous Quiz
32%
True
48%
False
10%
TypeError
10%
See solution
What will this code do?
(lambda: lambda: lambda: lambda: lambda: 1)()()()()()
What will this code do?
(lambda: 1 + lambda: 1 + lambda: 1)()()()
What will this code do?
(lambda: 1 + (lambda: 1 + (lambda: 1)())())()
What do you need to add to make the code work?
class A:
def __init__(self, x):
self.x = x
def __and__(self, other):
return self.x + other.x
a1 = A(1)
a2 = A(2)
# your code
output: 3
What will this code do?
def f(n):
x, y = -n, -n
return x is y
print(f(0), f(5), f(10))
What will this code do?
class A:
def __init__(self, value):
self.value = value
def __call__(self, other):
return self.value ** other
x = A(2)
print(x(3))