不幸的是 raw_input 没有做我需要做的事情。我想做的是让 totPrimes = 我在提示符下输入的任何内容。如果我while count < totPrimes
用while count < 50
这个脚本替换有效。如果我在提示中输入 50,这个脚本不起作用,恐怕 raw_input 不是我想要使用的函数?这是我的代码片段:
testNum = 3
div = 2
count = 1
totPrimes = raw_input("Please enter the primes: ")
while count < totPrimes :
while div <= testNum :