Python в тестах
3.17K subscribers
232 photos
25 links
Тесты по языку Python. Никакой воды.

@anothertechrock
Download Telegram
Channel created
What will be the output?
print(float('nan') + 10)
Anonymous Quiz
13%
10
14%
nan
20%
nan + 10
48%
Error
5%
Check answer
👍2
🦄1
What will be the output?
print([] is [])
Anonymous Quiz
60%
True
31%
False
9%
Check answer
👍2
We have a list s = ['a', 'b']. How to get the string 'ab' from it?
Anonymous Quiz
14%
sum(s)
11%
str(s)
55%
"".join(s)
10%
s.string()
7%
No way
4%
Check answer
👍2
Which method of lists inserts an element at a given position?
Anonymous Quiz
19%
append
62%
insert
6%
extend
6%
add
4%
None of these
3%
Check answer
👍1
What will be the output?
print(list([]))
Anonymous Quiz
47%
[]
8%
[[...]]
31%
[[]]
10%
list([])
4%
Check answer
👍1
How many elements will be in the tuple tuple('aabc')
Anonymous Quiz
32%
1
20%
3
27%
4
16%
You cannot create a tuple like this
4%
Check answer
👍2
What will be the output?
print(5 / float('inf'))
Anonymous Quiz
24%
0.0
3%
5
13%
5.0
13%
float('inf')
41%
Error
5%
Check answer
👍2
What will be the output?
print(dir(int) == dir(5))
Anonymous Quiz
48%
True
31%
False
14%
Error
7%
Check answer
👍1
🦄1
What will be the output?
print(1e3)
Anonymous Quiz
24%
1e3
35%
1000.0
26%
1000
10%
0.001
5%
Check answer
🦄1
Which option to import is not suitable, if we want to run the following line:
print(pi)
Anonymous Quiz
29%
from math import pi
16%
form math import *
30%
from math import pi as PI
20%
All are suitable
4%
Check answer
👍1👎1