【发布时间】:2016-03-29 03:36:09
【问题描述】:
我见过几个类似的问题,但没有一个能以正确的方式解决我的问题。这意味着它的回答方式要么不起作用,要么对我来说毫无意义。我会给你代码,这让我很适合和它给出的错误。
Error: unsupported operand type(s) for /: 'NoneType' and 'int'
是错误,代码是:
#Define iteration#
iteration=0;
iterationNum=0;
#Define encryption#
def encrypt(num,iteration):
num=cos(num/(iteration+1));
def runEncrypt(array,iterationNum):
for j in range(iterationNum):
for i in range (len(array)):
array[i]=encrypt(array[i],j);
#Internal test area#
array1=[1,2,3,4,5];
encryptedArray=runEncrypt(array1,4);
print(encryptedArray);
【问题讨论】:
标签: python arrays division operands