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

Showing posts older than #2702 · Back to latest

Older Posts 20 shown
Post #2701 775
Что выведет код?
x = [[y**x for y in range(1, 3)] for x in range(1, 3)]
print(x)
Post #2699 848
Что выведет код?
x = [*map(lambda x: x**2, [1, 2, 3])]
y = [x**2 for x in range(1, 4)]
print(x == y)
Post #2697 834
Что выведет код?
def f():
n = 0
def g():
nonlocal n
n += 1
def get():
return n
f.get = get
return g
g1, g2 = f(), f()
g1(), g2(), g1()
print(f.get())
Post #2695 881
Что выведет код?
from functools import partial
def spam(a, b):
print(a, b)
s = partial(spam, b=1)
s(2)
Post #2693 790
Что выведет код?
g = [lambda x, n=n: x+n for n in range(2)]
for f in g:
print(f(0), end='')
Post #2691 772
Что выведет код?
g = [lambda x: x+n for n in range(2)]
for f in g:
print(f(0), end='')
Post #2689 777
Что выведет код?
x = 1
a = lambda y, x=x: x + y
x = 2
b = lambda y, x=x: x + y
print(a(3), b(3))
Post #2687 1.06K
Что выведет код?
x = 1
a = lambda y: x + y
x = 2
b = lambda y: x + y
print(a(3), b(3))
Post #2685 897
Что выведет код?
s = ['3b', '1c', '2a']
x = sorted(s, key=lambda x: x[-1])
print(*x)
Post #2682 816
Что выведет код?
def f(s='', l=[]):
s += '1'
l.append(1)
return s, l
f()
s, l = f()
print(len(s), len(l))
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 →