赞
踩
strip() - 删除 string 字符串末尾的指定字符(默认为空格)
format - print(format(0.5,”.6f”)) –> 0.500000
format - print(“{:d} {:d}”.format(MIN,MAX))
def divisibleSumPairs(n, k, ar):
m=0
for i in ar:
ar2=ar.copy()
for j in ar2.remove(i):
if (i+j)\%k==0:
m+=1
return m
为什么不对? 报错信息是: for j in ar2.remove(i):TypeError: 'NoneType' object is not iterable
ar2.remove(i) 这个操作的返回值是None
def divisibleSumPairs(n, k, ar):
count = 0
for i in range(n-1):
for j in range(i+1,n):
if 0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。