TGViewer
Channel Public Channel
Python Tasks & ML | Задачи по питону и машинному обучению

Python Tasks & ML | Задачи по питону и машинному обучению

@python_tasks

Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks

Questions — @dina_ladnyuk
Subscribers
8.49K
Photos
30
Videos
1
Links
41

Showing posts older than #1588 · Back to latest

Older Posts 20 shown
Post #1586 2.06K
Что выведет код?
def f(test, *args):
res = []
for arg in args:
if test(arg):
res.append(arg)
return sum(res)
data = [-4, 2, -1, 5, -6, 3]
negative = lambda x: x < 0
neg = f(negative, *data)
positive = lambda x: x > 0
pos = f(positive, *data)
print(neg, pos)
  • 👍 1
Post #1583 2.08K
Что выведет код?
def maker(f, args, kwargs):
return 1 + f(*args, **kwargs)
m1 = maker(lambda a, b: a + b, (5, ), {"b": 2})
m2 = maker(lambda a, b: a * b, [4, 5], {})
print(m1 + m2)
  • 👍 1
Post #1579 2.07K
Что выведет код?
def f(s:str = "1") -> int:
return s * 2
print(f(), isinstance(f(), int))
Post #1578 2.23K
  • 👍 8
  • 💯 2
Post #1575 2.06K
Дан код
def f(a, b, c, d):
print(a, b, c, d)
Post #1574 2.19K
  • 👍 14
Post #1573 2.05K
Что выведет код?
def func(a, b):
a = 2
b[0] = 10
x = 1
y = 1, 2
func(x, y)
print(x, y)
  • 👍 5
Post #1571 2.24K
  • 👍 5
  • 😱 1
Post #1570 2.2K
Что выведет код?
def func(а, b):
а[0] = 2
b = b[:]
b[0] = 10

a, b = [0], [1]
func(a, b)
print(a, b)
  • 👍 7
Post #1569 2.59K
  • 👍 12
Post #1568 2.34K
Что выведет код?
def func(а, b):
а = 2
b = b[:]
b[0] = 10

a, b = [0], [1]
func(a, b)
print(a, b)
Post #1564 1.99K
Что выведет код?
def f():
x = 1
def g():
x += 1
g()
print(x)
print(f())
Post #1563 2.14K
  • 👍 12
  • 🤔 10
  • 🤓 2
Post #1562 2.06K
Что выведет код?
a = b, c = [1, 2]
a[0] = 10
print(b, c)
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →