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

Older Posts 20 shown
Post #1795 2.39K
Что выведет код?
import re
sent = 'Hello, Ben! How are you doing?'
lister = filter(None, re.split("[,!?]+", sent))
print(len(list(lister)))
Post #1793 2.83K
  • 🔥 16
  • 👍 4
  • 🤬 1
Post #1792 2.77K
Что выведет код?
class A:
def __iter__(self):
yield from range(10)
a = A()
print(5 in a, 20 in a)
Post #1790 2.54K
Дан код:
class A:
x = 1
def __init__(self):
self.y = 2

a = A()
Post #1788 2.6K
Что выведет код?
a = 1; b = 2
print(eval('print(a + b, end=" ") or 0'))
  • 👍 3
Post #1787 2.76K
  • 👍 2
  • 🔥 1
Post #1786 2.34K
Дан код
def f(n):
def g(x):
return x ** n
return g

g = f(3)
print(g(2), g(3))
Post #1784 2.24K
Что выведет код?
a = 0
def func():
global a
for num in [2, 4, 8]:
a += 1
yield num * 0.5

array = []
for val in func():
array.append(int(a == val))
print(sum(array))
  • 👍 2
Post #1783 2.35K
  • 🔥 8
  • 🤬 4
  • 👍 1
Post #1782 2.2K
Что выведет код?
print(2 ^ 3 ^ 3 ^ 2 ^ 2 ^ 4 ^ 2 ^ 4 ^ 2)
  • 👍 1
Post #1780 2.23K
Что выведет код?
print(sorted([str(x) for x in range(1, 30, 5)]))
  • 👍 8
Post #1778 2.42K
Что выведет код?
a = {1, 2, 3}
b = {3, 2, 1}
print(a == b, a is b)
Post #1776 2.14K
Что выведет код?
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
return self._x

a = A(1)
print(A.x.fget(a), a.x)
  • 👍 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 →