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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
26%
0
62%
RuntimeError
12%
KeyError
gen = (x for x in range(5))
print(2 in gen, 2 in gen)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
31%
True True
67%
True False
2%
False False
tpl = ([],)
tpl[0].extend([1, 2])
print(tpl)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
67%
([1, 2],)
25%
([],)
8%
TypeError
a = 256
b = 256
c = 257
d = 257
print(a is b, c is d)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
35%
True True
46%
True False
19%
False False
🔥1
gen = (x for x in range(3))
a = list(gen)
b = list(gen)
print(a, b)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
31%
[0, 1, 2] [0, 1, 2]
63%
[0, 1, 2] []
6%
TypeError
def modify(x, y=[]):
y.append(x)
return sum(y)

result = modify(5) + modify(7) + modify(4)
print(result)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
27%
16
71%
33
2%
21
def modify(x, y=[]):
y.append(x)
return sum(y)

result = modify(5) + modify(7) + modify(4)
print(result)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
27%
16
71%
33
2%
21
👍1
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
❤2
Варианты ответа:
Anonymous Quiz
48%
31
31%
15
21%
32
def modify(x, y=[]):
y.append(x)
return sum(y)

result = modify(5) + modify(7) + modify(4)
print(result)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
26%
16
74%
33
0%
21
👍1
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
31%
[0, 1, 2] [0, 1, 2]
64%
[0, 1, 2] []
5%
TypeError
x = [0, 1]
i = 0
i, x[i] = 1, 2
print(x)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
31%
[2, 1]
66%
[0, 2]
3%
[2, 0]