My list is returning the error "object of type 'float' has no len()
". The problem is that before asking for the list length I check if the list is in fact a list and it is. Here it is the portion of code where this error occurs
if isinstance(sprints, list):
if len(sprints) == 0:
plt.xticks(firstelement)
else:
plt.xticks(sprints)
else:
print("Not a List")
仅当列表为空时才会发生此错误,当列表中有对象时可以正常工作。 我已经尝试过“如果不是冲刺” sintax,并且会发生相同的错误。 有什么建议么?