I'm trying to generate a list with a variable that I can control. So let's say I want to generate a list of length 100 with conditions:
[True if x > 0.8 else False for x in [random_number_between_0_and_1]]
So the list will have 2:8 True/False values, and so on. I tried something like this but my syntax is off:
my_list = []
True if x > 0.8 else False for x in random()
my_list.append(i)
Any help is appreciated!