How to have a percentage chance of a command to run

okay so if you want two mutually exclusive events with one occurring 20% of the time and the other occurring 25% of the time, then

chance = random.randint(1,100)
if chance <= 20:
    print("20% chance of getting this")
elif chance <= 20+25:
    print("25% change of getting this")

if you want them to be independent and not influence each other, you have to generate another random number.

chance = random.randint(1,100)
if chance <= 20:
    print("20% chance of getting this")

chance = random.randint(1,100)
if chance <= 25:
    print("25% change of getting this")