use*_*391 -3 python python-3.x
我有这个功能,但我不熟悉错误或如何纠正它.
def intify(file1):
numbers=range(0,10)
strnum=[]
for x in numbers:
strnum.append(str(x))
number1=[]
for line in file1:
for split in line.split(' '):
number1.append(split)
listnum=[]
for x in number1:
if x[0] in strnum:
listnum.append(x)
w=map(float, listnum)
#return w
print(w)
Run Code Online (Sandbox Code Playgroud)
错误映射对象位于0x275b990
错误映射对象位于0x275b990
这不是错误 - 您只需打印返回的迭代器的地址map.你可以打印list(w)以确保一切正常.当然,你不应该回来, list(w)因为它是不必要的和昂贵的.