-1
import random
semente=int(input("por favor, digite a semente do gerador aleatório:"))
print(" ")
print("Início da simulação")
random.seed(semente)
cap_inicial_1 = random.randrange(20,51)
cap_inicial_2 = random.randrange(20,51)
cap_inicial_3 = random.randrange(20,51)
while(cap_inicial_1 <= cap_inicial_2 or cap_inicial_2 <= cap_inicial_3 or cap_inicial_1 <= cap_inicial_3):
if(cap_inicial_1 < cap_inicial_2):
cap_inicial_2 = random.randrange(20,51)
if(cap_inicial_2 < cap_inicial_3):
cap_inicial_3 = random.randrange(20,51)
print(" ")
print("capacidade inicial 1: ",cap_inicial_1,"capacidade inicial 2: ",cap_inicial_2,"capacidade inicial 3:",cap_inicial_3)
Give an example of seed in which this occurs, please. And when you say the
print
does not occur, the program simply goes out, or enters a loop infinite?– mgibsonbr
I suggest [Dit] your question in more detail than this code is trying to do, so we can help you better. In any case, I’ve already identified a potential problem, and posted as an answer.
– mgibsonbr