What will the following code return? l = {i%2 for i in range(10)}
Explanation
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
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести