For example
a = "a"
b = "b"
c = "c"
d = "d"
taking these variables and choosing a random one
a = "a"
b = "b"
taking these variables, at a 75% chance choosing a and at a 25% chance choosing b
For example
a = "a"
b = "b"
c = "c"
d = "d"
taking these variables and choosing a random one
a = "a"
b = "b"
taking these variables, at a 75% chance choosing a and at a 25% chance choosing b
You can add weights to random.choices
This is how I did it:
import random
lst= ["a", "b"]
print(random.choices(lst, weights=(0.75, 0.25), k=1))
k = 1 represents the amount of values to choose from the list, which, in our case, is only 1.