Заметки Питониста
14.7K subscribers
3.37K photos
18 videos
1.82K links
Все что связано с Python, уже в наших заметках.

Ссылка: @Portal_v_IT

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


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
31%
[1, 4, 5, 2, 3]
34%
[1, 4, 5, 3]
34%
[1, [4, 5], 2, 3]
data = {1: "A", True: "B"}
print(data[1])


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
37%
A
51%
B
12%
KeyError
print(round(1.5), round(2.5))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
34%
2 3
39%
1 2
27%
2 2
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
37%
[0, 1, 2] [0, 1, 2]
55%
[0, 1, 2] []
7%
TypeError
x = "global"
res = [x for x in ["local", "scope"]]
print(x)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
24%
scope
18%
local
58%
global
class A:
def __new__(cls):
return 42

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

print(A())


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
😱1
Варианты ответа:
Anonymous Quiz
40%
42
35%
Init 42
24%
TypeError
val = 10

def update():
global val
val = 20
del val

update()

try:
print(val)
except NameError:
print("NameError")


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
19%
10
33%
20
48%
NameError
def swap(a, b):
return b, a

x, y = 10, 20
x, y = swap(x, y)
x, y = swap(y, x)
print(x + y)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
75%
30
25%
40
0%
20
x = 1

def func():
x = 2
print(globals()['x'])

func()


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
49%
1
32%
2
18%
KeyError
👍1
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
43%
[0, 6]
37%
[0, 2, 3, 4, 6, 8, 9]
20%
SyntaxError
print(-11 % 3, 11 % -3)


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

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