Заметки Питониста
14.8K subscribers
3.36K photos
18 videos
1.81K links
Все что связано с Python, уже в наших заметках.

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
53%
True True
21%
False False
26%
TypeError
for i in range(3):
if i == 5:
break
else:
print("A", end="")
print("B", end="")


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
62%
AB
19%
B
9%
A
10%
Посмотреть ответ
d = {'a': 1, 'b': 2, 'c': 3}
try:
for k in d:
del d[k]
print(len(d))
except RuntimeError:
print("RuntimeError")


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
36%
0
56%
RuntimeError
8%
KeyError
class Context:
def __enter__(self):
return "A"
def __exit__(self, *args):
return True

with Context() as c:
raise ValueError()

print(c)


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
48%
A
43%
ValueError
9%
None
x = "global"
res = [x for x in ["local", "scope"]]
print(x)


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
14%
scope
20%
local
66%
global
gen = (x for x in range(3))
list(gen)
print(list(gen))


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
54%
[0, 1, 2]
43%
[]
3%
TypeError
This media is not supported in your browser
VIEW IN TELEGRAM
Появился новый провайдер LLM - SaveRouter: лёгкий и выгодный доступ к Fable 5 и Opus 4.8 🧠

Самые современные модели Anthropic стали доступны и без лимитов.

$50 на тестирование — каждому пользователю Telegram Premium при регистрации

Скидка 70% всем, кто зарегистрируется до 23:59 UTC 24.07 (3:00am по Мск)

• Лучший вариант для OpenClaw, Hermes и других AI-агентов
• Совместимость с Anthropic API: Claude Code, Cursor, Cline, aider — подключение за 2 минуты

👉 svrtr.org
tpl = ([],)
tpl[0].extend([1, 2])
print(tpl)


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
61%
([1, 2],)
23%
([],)
16%
TypeError
def add_item(num, lst=[]):
lst.append(num)
return lst

add_item(1)
print(add_item(2))


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
15%
[2]
82%
[1, 2]
3%
TypeError
def add_item(num, lst=[]):
lst.append(num)
return lst

add_item(1)
print(add_item(2))


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
17%
[2]
75%
[1, 2]
8%
TypeError
class Model:
val = 1
lst = [val for _ in range(3)]

print(Model.lst)


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
63%
[1, 1, 1]
29%
NameError
8%
AttributeError
x = [1, 2, 3, 4, 5]
x[::2] = [10, 20, 30]
print(x)


💕 Наш уютный чатик

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM