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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
class Matrix:
def __init__(self, data):
self.data = data

def __add__(self, other):
return Matrix([[self.data[i][j] + other.data[i][j]
for j in range(len(self.data[0]))]
for i in range(len(self.data))])

def sum(self):
return sum(sum(row) for row in self.data)

m1 = Matrix([[1, 2], [3, 4]])
m2 = Matrix([[5, 6], [7, 8]])
result = m1 + m2
print(result.sum())

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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
61%
36
36%
10
3%
18
def make_counter():
count = 0
def increment():
nonlocal count
count += 1
return count
return increment

c1 = make_counter()
c2 = make_counter()
c1()
print(c1(), c2())


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
54%
2 1
34%
2 2
11%
1 1
lst = [x for x in range(10) if x % 2 == 0 if x % 3 == 0]
print(lst)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
55%
[0, 6]
30%
[0, 2, 3, 4, 6, 8, 9]
16%
SyntaxError
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
24%
0
63%
RuntimeError
13%
KeyError
from itertools import islice

def infinite_seq():
n = 1
while True:
yield n
n *= 2

gen = infinite_seq()
result = list(islice(gen, 5))
print(sum(result))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
39%
31
39%
15
21%
32
gen = (x for x in range(3))
print(list(gen), list(gen))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
32%
[0, 1, 2] [0, 1, 2]
57%
[0, 1, 2] []
11%
TypeError
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
34%
0
61%
RuntimeError
5%
KeyError
def f(x, y, z):
return x + y + z

d1 = {'x': 1, 'y': 2}
d2 = {'y': 3, 'z': 4}

try:
print(f(**d1, **d2))
except TypeError:
print("TypeError")


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
26%
8
37%
10
37%
TypeError
Пока вы платите за западные нейросети – китайские делают то же самое бесплатно

ChatGPT и Claude Code давно у всех на слуху. Но за последние годы в Китае появилось множество мощных AI-инструментов, которые умеют не меньше – а главное, почти все бесплатны и доступны пользователям из России.

DeepSeek, Qwen, Hailuo и другие ИИ уже умеют работать с текстом, изображениями, кодом и анализом не хуже других нейросетей.

В Зерокодере собрали их в новом бесплатном вебинаре «Китайские нейросети 2026–2027».

⚡️Что ждет вас на вебинаре?

• Проведем глубокое исследование рынка и превратим его в личный дашборд;
• Сделаем сайт без разработки с нуля;
• Сгенерируем кадры для собственного нейросериала;
• Протестируем функции, которых нет у западных ИИ-флагманов;
• Соберем собственный ИИ-стек для работы и проектов.

Не нужно выбирать между десятками сервисов и самостоятельно разбираться, что действительно работает. Вам покажут актуальные инструменты и их применение на практике.

Бонусом – справочник по 10 китайским ИИ и доступ к закрытой базе по нейросетям.

Бесплатный эфир по ссылке – регистрируйтесь
class A:
def __new__(cls):
return 42

def __init__(self):
print("Init")

print(A())


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
44%
42
37%
Init 42
19%
TypeError
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
23%
0
63%
RuntimeError
15%
KeyError