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.5K
Photos
30
Videos
1
Links
41

Showing posts older than #2021 · Back to latest

Older Posts 20 shown
Post #2020 1.72K
Что выведет код?
def f(a: int = '1', b: int = '2', c: int = '3') -> int:
return a + b + c
print(f())
Post #2018 1.88K
Что выведет код?
import sys
f = lambda x: list(map(sys.stdout.write, x))
t = f(['1', '2', '3'])
Post #2016 1.78K
Что выведет код?
def f(a: int = 5, b: int = 3, c: int = 4) -> int:
return a + b + c
print(f(2.5, b=2))
Post #2014 1.81K
Что выведет код?
f = (lambda х, у: х if х < у else у)
z1 = f('b', 'а')
z2 = f('а', 'b')
print(z1 == z2)
Post #2011 1.75K
Что выведет код?
def f(a: int = 2, b: int = 2) -> int:
return a ** b
print(f(3))
Post #2008 1.82K
Что выведет код?
def f(L):
s = ''
items = list(L)
while items:
first = items.pop(0)
if isinstance(first, str):
s += first
else:
items[:0] = first
return s
print(f(('a', ('b', ('c', ('d', 'e'))))))
  • 🤔 1
Post #2006 1.76K
Что выведет код?
from collections.abc import Iterable
def f(arr):
s = 0
items = list(arr)
while items:
first = items.pop(0)
if not isinstance(first, Iterable):
s += first
else:
items.extend(first)
return s
print(f((1, (2, (3, (4, (5)))))))
  • 👍 5
Post #2004 1.81K
Что выведет код?
def f(arr):
s = 0
for x in arr:
if not isinstance(x, list):
s += x
else:
s += f(x)
return s
print(f([1, [2, [3, [4, [5]]]]]))
Post #2002 1.69K
Что выведет код?
def f(x, y):
z = x ** y
return z
print(f.__code__.co_argcount)
  • 🔥 1
Post #2001 2.34K
  • 👍 2
  • 🔥 1
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 →