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

Ссылка: @Portal_v_IT

Сотрудничество: @oleginc
Download Telegram
Варианты ответа:
Anonymous Quiz
68%
(1, 2, [3, 4, 5])
24%
TypeError
8%
(1, 2, [3, 4])
def f(x, y, z):
return x + y + z

d1 = {'x': 1, 'y': 2}
d2 = {'y': 3, 'z': 4}

try:
print(f(**d1, **d2))
except TypeError:
print("TypeError")


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
33%
8
38%
10
28%
TypeError
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
❤1
Варианты ответа:
Anonymous Quiz
48%
[0, 6]
36%
[0, 2, 3, 4, 6, 8, 9]
17%
SyntaxError
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
60%
20
29%
25
11%
15
❤2
d1 = {'a': 1, 'b': 2}
d2 = {'b': 3, 'c': 4}
print(d1 | d2)


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
d = {'a': 1, 'b': 2, 'c': 3}
try:
for k in d:
del d[k]
print(len(d))
except RuntimeError:
print("RuntimeError")


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
25%
0
69%
RuntimeError
6%
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
34%
True True
62%
True False
4%
False False
def add_item(val, target=[]):
target.append(val)
return target

print(add_item(1), add_item(2))


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

#Python
Please open Telegram to view this post
VIEW IN TELEGRAM
Варианты ответа:
Anonymous Quiz
41%
[1] [1, 2]
39%
[1] [2]
20%
[1, 2] [1, 2]
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
❤1
Варианты ответа:
Anonymous Quiz
57%
5
35%
2
9%
IndexError
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
4%
50
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