How could I randomize a list or array of numbers with different percentages? For example:
import random
random = random.randint(1, 3)
if random == 1:
print('1')
elif random == 2:
print('2')
elif random == 3:
print('3')
#1 = blank%percent chance of happening
#2…
#3…
To clarify, is there a way for there to be a certain percent chance for the 1 (or any other number) to print? Like 1 has a 4% chance of happening, 2 has a 93% chance of happening, and 3 has a 3% chance of happening. Just a question that popped up.