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 #1704 · Back to latest

Older Posts 20 shown
Post #1702 3.47K
  • 👏 9
  • 👍 1
  • 👎 1
Post #1700 2.51K
  • 😱 9
  • 👍 8
Post #1698 2.59K
  • 👍 9
  • 😱 2
  • 🤬 1
Post #1697 2.49K
Что выведет код?
def f(a, b, c, d, e):
print(a, b, c, d, e)

f(1, *(3,), c=10, **{"d": 5, "e": 100})
  • 🔥 4
  • 😱 2
Post #1695 2.55K
Что выведет код?
x = 1
def f():
def g():
nonlocal x
print(x)
x += 1
return g
Post #1693 3.38K
Что выведет код?
def unpacking(x, y):
print(x, y, end=" ")
tuple_vec = (1, 0)
dict_vec = {'x': 1, 'y': 0}
unpacking(*tuple_vec)
unpacking(**dict_vec)
  • 👍 1
Post #1691 2.83K
  • 👍 10
Post #1690 2.69K
Что выведет код?
c = filter(lambda x: x>=3, map(lambda x: x+x, (1, 2, 3, 4)))
print(list(c))
Post #1688 2.56K
Что выведет код?
c = map(lambda x: x + x, filter(lambda x: (x>3), (1, 2, 3, 4)))
print(list(c))
  • 👍 3
Post #1687 2.62K
  • 👍 11
  • 👨‍💻 1
Post #1686 2.41K
Что выведет код?
x = {1: "A", 3: "B"}
y = {2: "C", 3: "D", 4: "E"}
d = {**x, **y}
vals = sorted(d.values())
print(*vals)
  • 🔥 4
Post #1685 2.52K
  • 👍 11
Post #1684 2.3K
Что выведет код?
from functools import reduce
y = reduce(lambda a, b: a + b , [1, 2, 3, 4])
print(y)
Post #1682 2.49K
Что выведет код?
def f():
import sys
locs = sys._getframe(1).f_locals
setattr(locs['self'], 'xy', 4*locs['x'] + 7*locs['y'])

class A:
def __init__(self, x, y):
self.xy = 2*x + 3*y
f()

a = A(2, 3)
A.xy = 99
print(a.xy)
  • 👍 2
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 →