isagalaev ("Ivan Sagalaev :flag_wbw:") wrote:
Old habits die hard. Needed to choose randomly one of 18 items printed out on a piece of paper, with some exclusions. Went to #Python:
random.choice(list(set(range(1, 19)) - {5, 11}))
isagalaev ("Ivan Sagalaev :flag_wbw:") wrote:
Old habits die hard. Needed to choose randomly one of 18 items printed out on a piece of paper, with some exclusions. Went to #Python:
random.choice(list(set(range(1, 19)) - {5, 11}))