import random
def main():
number = random.randint(0,100)
print(number)
guess = int(input("Enter your guess: "))
if guess == number :
print("You win $10,000!")
elif guess // 10 == number // 10 or guess % 10 == number % 10 :
print("You win 1,000$!")
elif guess // 10 == number // 10 and guess % 10 == number % 10 :
print("You win $3,000!")
else :
print("You win $0.")
main()
and
该程序的工作原理是语句除外。有谁知道为什么?