What will the following code return? l = {i%2 for i in range(10)}
Provided expression is a set comprehension. It first iterates over numbers from 0 to 9 and calculates the remainder from division by 2 for each of them. Remainders are later collected into a set. Therefore {0, 1} is correct answer

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Python
Зареєструйся Зараз
або Підпишись на майбутні тести