I want to draw a number from a gammavariate, but I want to set an upper limit.
Why this does not work?
[int(random.gammavariate(3, 3)) if x < 21 else 20 for x in range(1)]
Why making things complicated?
x is always
0 in your list comprehension.
try it this way:
x = int(random.gammavariate(3,3)) [x if x < 21 else 20]