+ 3

how to make a set of numbers from 0 to 100 by using a loop range(100)?

https://code.sololearn.com/cDO6Qcsj9yU2/?ref=app

19th Nov 2022, 6:02 PM
PASHA from Russia 🇷🇺
PASHA  from Russia  🇷🇺 - avatar
7 Answers
+ 3
Yes, Ipang. A unique container.
19th Nov 2022, 7:15 PM
PASHA from Russia 🇷🇺
PASHA  from Russia  🇷🇺 - avatar
+ 2
A set of numbers as in a sequence of numbers or a `set` (unique container) of numbers?
19th Nov 2022, 6:28 PM
Ipang
+ 1
{x for x in range(100)}
19th Nov 2022, 7:56 PM
Tibor Santa
Tibor Santa - avatar
+ 1
numbers = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" } for k in range(100): for j in numbers: print(j)
19th Nov 2022, 8:19 PM
JaScript
JaScript - avatar
+ 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 : )
20th Nov 2022, 3:45 AM
Ipang
0
Буль
1st Feb 2023, 7:22 AM
Денисыч
Денисыч - avatar
0
Я рыбка
1st Feb 2023, 7:22 AM
Денисыч
Денисыч - avatar