TGViewer
Python Tasks & ML | Задачи по питону и машинному обучению Python Tasks & ML | Задачи по питону и машинному обучению @python_tasks · 8.49K subscribers
Post #1175 2.8K
Что выведет код?
from collections import ChainMap
d1 = {'x': 1, 'z': 10}
d2 = {'y': 2, 'z': 20}
d3 = {**d1, **d2}
d4 = ChainMap(d1, d2)
s1 = d3['x'] + d3['y'] + d3['z']
s2 = d4['x'] + d4['y'] + d4['z']
print(s1, s2)
More from @python_tasks
  1. May 25, 2026Post #3221
  2. May 25, 2026Что выведет код? def f(): import sys locs = sys._getframe(1).f_locals setattr(locs['self']…
  3. May 22, 2026Post #3219
  4. May 22, 2026Что выведет код? def f(x): if x < 3: return x y = filter(f, (0, 1, 2, 3, 4)) print(list(y)…
  5. May 21, 2026Post #3217
  6. May 21, 2026Что выведет код? def func(x): if x >= 3: return x y = filter(func, (1, 2, 3, 4)) print(lis…
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 →