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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
32%
True True
62%
True False
6%
False False
s1 = {1, 2}
s2 = {2, 3}
print(s1 ^ s2)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
39%
{1, 2, 3}
22%
{2}
39%
{1, 3}
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
41%
8
22%
10
37%
TypeError
res = map(lambda x: x * 2, [1, 2])
print(list(res))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
11%
[1, 2]
83%
[2, 4]
6%
(2, 4)
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
40%
8
21%
10
38%
TypeError
def calculate(x, y):
if x > y:
return x - y
else:
return y - x

result = calculate(10, 15) + calculate(20, 8)
print(result)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
73%
17
19%
7
8%
25
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
58%
True
29%
False
12%
None
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
64%
36
28%
10
8%
18
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
28%
[0, 1, 2] [0, 1, 2]
60%
[0, 1, 2] []
12%
TypeError
print(1 in [1, 2] == True)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Варианты ответа:
Anonymous Quiz
59%
True
28%
False
13%
TypeError
👍1🔥1
Media is too big
VIEW IN TELEGRAM
🔥 Нашли сервис, который позволяет за пару минут собрать под себя полноценный курс по любой теме — Gurufy.

🔅 Это не просто чат как ChatGPT, а целая экосистема, которая позволяет разобраться в вопросах чуть сложнее, чем «какая сегодня погода».

🔅 По запросу создаётся план курса, а в каждой статье — иллюстрации, интерактивные виджеты, отдельный ИИ-ассистент и задания для закрепления материала.

🔥 Попробовать можно бесплатно.

Ссылка на сервис → https://gurufy.ru
Please open Telegram to view this post
VIEW IN TELEGRAM
try:
1 / 1
except ZeroDivisionError:
print("A", end="")
else:
print("B", end="")
finally:
print("C", end="")


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

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