对于 python 分配,我需要要求用户输入数字,直到他们输入负数。到目前为止,我有:
print("Enter a negative number to end.")
number = input("Enter a number: ")
number = int(number)
import math
while number >= 0:
numberagain = input("Enter a number: ")
numberagain = int(numberagain)
while numberagain < 0:
break
如何将用户输入值的次数加起来