+ 3
how to make a set of numbers from 0 to 100 by using a loop range(100)?
7 Réponses
+ 3
Yes, Ipang. A unique container.
+ 2
A set of numbers as in a sequence of numbers or a `set` (unique container) of numbers?
+ 1
{x for x in range(100)}
+ 1
numbers = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
}
for k in range(100):
for j in numbers:
print(j)
+ 1
Павел Сливенко 🇷🇺
Tibor Santa's example was also what I had in mind, it's simple and neat.
Depending on whether the 100 was to be included on the `set`, you might need to adjust the range() second argument between 100 and 101 (100 inclusive). But I guess you know that : )
0
Буль
0
Я рыбка