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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
48%
4
50%
5
2%
6
funcs = [lambda: i for i in range(3)]
print(funcs[0](), funcs[-1]())


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
52%
0 2
33%
2 2
15%
NameError
class A: pass
class B(A): pass
class C(A): pass
class D(B, C): pass
print(D.mro()[1].__name__)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
36%
А
38%
B
27%
C
d = {1: "A", True: "B", 1.0: "C"}
print(len(d), d[1])


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:ё
Anonymous Quiz
30%
3 C
52%
1 C
18%
1 A
print(any([0, "", False]))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
35%
True
61%
False
4%
None
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
48%
[1, 1, 1]
30%
NameError
22%
AttributeError
lst = [1, 2, 3]
lst[1:2] = [4, 5, 6]
print(lst)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
40%
[1, [4, 5, 6], 3]
46%
[1, 4, 5, 6, 3]
14%
TypeError
s = {1, 2, 3}
s.update([3, 4, [5]])
print(len(s))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
45%
TypeError
34%
5
21%
4
d = {'a': 1}
print(d.setdefault('a', 2), d.setdefault('b', 3))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
29%
2 3
46%
1 3
25%
KeyError
keys = ['a', 'b', 'c']
vals = [1, 2]
d = {k: v for k, v in zip(keys, vals)}
print(d)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1
print(isinstance(True, int))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
61%
True
33%
False
6%
TypeError