import random
counter = 0
count = 0
counting = 0
valueOne = 0
valueTwo = 0
while counter ==0:
playerOne = random.randint(1,10)
number = random.randint(1,10)
关于这里,我感到困惑。它将运行循环,但是每次运行时,随机值都会重置,即使第一次打印随机数,第二次也可能打印相同,依此类推。
if number == playerOne:
count = count + 1
if number != playerOne:
valueOne = playerOne
if number != valueOne:
print("lotto number",number)
counting = counting + 1
if counting >= 4:
print("it took you this many trys",count)
input('play again?')
counting = 0
count = 0
答案 0 :(得分:0)