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
Зарегистрируйся сейчас
или Подпишись на будущие тесты