I am trying to generate random numbers and put them into a set. I decided to do it using for loop and range function:
for x in range(0, 21, 1):
print(x)
Now I would like to put all the numbers into a set. I am using following code:
x_set = set(str((x)))
print(x_set)
Unfortunately the outcome is:
{'0', '2'}
I would like to put all numbers into a set (1 - 20). What am I doing wrong?
I am not looking for ready answers. Please show me the way to follow.