I am new to the Python language. In one subject, they ask us to do the homework with this language and to investigate it on our own. In this part of the code, I first declare the range with the range(0, 1024) method, and the random numbers are generated with the sample method, and I believe that these are saved in a list, so what I want to do next is that these Numbers that were generated randomly convert them to binary, but I get this error:
TypeError: 'list' object cannot be interpreted as an integer
So I don't know if there is a way to convert a list to whole numbers or I don't know what else they would recommend me to do ...
This is my code:
y = list(range(0, 1024))
numRandom = sample(y, 10)
print(numRandom)
print(bin(numRandom))