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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
print(1 in [1, 2] == True)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
57%
True
24%
False
19%
TypeError
class A:
def __init__(self):
self.__x = 1

def get_x(self):
return self.__x

class B(A):
def __init__(self):
super().__init__()
self.__x = 2

b = B()
print(b.get_x())


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

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


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
55%
([1, 2],)
29%
([],)
17%
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
35%
1
25%
2
39%
3
data = [1, 2, 3]
data += [4, 5]
data = data[1:-1]
print(sum(data))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
34%
15
61%
9
5%
6
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
32%
[1, 1, 1]
51%
NameError
17%
AttributeError
data = [1, 2, 3]
data += [4, 5]
data = data[1:-1]
print(sum(data))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
24%
15
72%
9
4%
6
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
25%
[1, 1, 1]
59%
NameError
16%
AttributeError
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
29%
[1, 1, 1]
55%
NameError
16%
AttributeError
def increment(x):
x += 10
return x

value = 5
new_value = increment(value)
print(value + new_value)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
73%
20
20%
25
6%
15
data = [5, 10, 15, 20]
data.extend([x // 2 for x in data[:2]])
print(sum(data))


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

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