# generate a random number between 1 and 99 sgenrand.randint(1,99) # your code goes here
print("Enter coins that add up to 81 cents, one per line.")
#promp the user to start entering coin values that add up to 81
coin = (sgenrand.randint(1,99))
number1 = ("Enter first coin: ")
sum = 0
number1 = eval(input("Enter first coin: "))
while number1 != coin:
if number1 != coin:
number1 = eval(input("Enter next coin: "))
我陷入了这个while循环。我希望用户可以在没有答案的情况下按 Enter 并跳出循环。在他爆发后,计算他之前添加的数字的总和,如果总和不是81。告诉用户他没有达到目标值,告诉他他达到了什么值并询问他是否要重新开始!