So I started to look into python today and I made this script. It works exactly as intended but I don’t know why. So I generate a random number three times like shown below but I label all three the same, as random_number. Shouldn’t that mean all three only use the first randomly generated number? I’m sorry if this is a very silly question, I’m just curious.
random_number =random.randint(1,3)
print(random_number)
if 1 == random_number :print(name1)
if random_number == 2 :print(name2)
if random_number == 3 :print(name3)