Python & ML tasks
415 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?
2 > '1'
What will this code do?
x = [1, 2, 3, [4, 5], 6]
print(x[x[3][0]])
What will this code do?
(lambda x: x**2 if '' or None or 1 and [False] else lambda x: x*2)(3)
What will this code do?
x = [[0]]
x = x + x * 2
x[0].append(1)
print(x)
Given code (Python3):
class A:
# your code
def f():
print('hi')
a = A()
a.f()
What do you need to add to make the code work?
Anonymous Quiz
27%
none of the above
14%
See solution
Given code (Python3):
class A:
# your code
def f():
print('hi')
a = A()
A.f()
What do you need to add to make the code work?
Anonymous Quiz
12%
none of the above
6%
See solution
Given code
class A:
pass
class B:
pass
class C(A, B):
pass
class D(C):
pass
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