0
sides=random.randrange(3,10)

I'd like to add 360 to the numbers that could be randomly selected.

I want a random number from the following numbers:

[3, 4, 5, 6, 7, 8, 9, 10, 360]

I know how to get a random number from 3 to 10, but I don't know how to make 360 a possible choice too.

U13-Forward
  • 69,221
  • 14
  • 89
  • 114
Ella
  • 11
  • 3
  • Do you want 3-360 or 3-10 + 360 so 3,4,5,6,7,8,9,10,360? – The Grand J Jan 04 '21 at 07:25
  • 1
    Does this answer your question? [How to randomly select an item from a list?](https://stackoverflow.com/questions/306400/how-to-randomly-select-an-item-from-a-list) – Mr. T Jan 04 '21 at 09:39

1 Answers1

1

You could use random.choice:

>>> import random
>>> random.choice([*range(3, 11), 365])
5
>>> 
U13-Forward
  • 69,221
  • 14
  • 89
  • 114