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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
26%
[2]
72%
[1, 2]
2%
TypeError
class MockObject:
def __new__(cls):
return 42

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

obj = MockObject()
print(obj)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
26%
Init 42
62%
42
11%
TypeError
def modify(n):
n = n + 5
n *= 2
return n

x = 10
result = modify(x) + x
print(result)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
16%
30
80%
40
3%
50
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
48%
[2, 1]
50%
[0, 2]
2%
[2, 0]
a = [[1, 2], [3, 4]]
b = list(a)
a[0][1] = 5
print(b[0][1])


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
47%
5
43%
2
10%
IndexError
🔥1
for i in range(2):
try:
print(i, end="")
continue
finally:
print("F", end="")


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
32%
01F
56%
0F1F
12%
01
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
53%
[0, 6]
29%
[0, 2, 3, 4, 6, 8, 9]
17%
SyntaxError
colors = ['red', 'green', 'blue']
colors.insert(1, colors.pop())
colors.reverse()
print(colors[0])


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
26%
red
48%
green
26%
blue
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
58%
[1, 1, 1]
30%
NameError
12%
AttributeError
data = {}
data.setdefault("keys", []).append(1)
data.setdefault("keys", []).append(2)
print(data["keys"])


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
54%
[1, 2]
41%
[2]
5%
TypeError
class A:
x = 1

class B(A):
pass

class C(A):
pass

B.x = 2
A.x = 3

print(C.x)


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

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