0
我學習巨蟒-3現在蔭試圖實現階乘函數我寫道:的Python 3因子
fact = 1
a = input('Enter number for factorial operation: ')
for b in range (1, a+1, 1):
fact = fact * b
print ("Sum is ", fact)
它說:
for b in range (1, a+1, 1):
TypeError: Can't convert 'int' object to str implicitly
可能會感興趣:http://stackoverflow.com/a/25111524/ 198633 – inspectorG4dget 2014-09-22 21:23:51