range()仅将int值用作参数。所以会报错。

原:

n=input("輸入")

 

解决方法:

1.eval() 

n=eval(input("輸入"))

 

2.用int()

n=int(input("輸入"))