from random import randrange
k=input("pick a door 0,1,2: ")
h=(randrange(3))
while h==k:
if h!=k:
break
h=(randrange(3))
print(h)
why does this not make the output of h always different then k
this is the full code
from random import randrange
x=(randrange(3))
k=input(“pick a door 0,1,2: “)
h=(randrange(3))
while h==k:
if h!=k:
break
h=(randrange(3))
print(“I remove door”)
print(h)
j=input(“would you like to switch 1 if yes 2 if no: “)
if j==0:
if j==x:
print(“you win”)
else:
print(“you lose”)
else:
if j!=x:
print(“you win”)
else:
print(“you lose”)
New contributor
1