-1
list = "\n==== Names and Distances ====\n"
firstName = input ("Enter next person's first name >")
while firstName > "":
distance= float(input("Enter distance thrown: "))
lastName = input ("What is "+firstName+"'s last name?")
list = list + firstName[0] + "." + lastName + str(distance) + "\n"
firstName = input ("Enter next person's first name >")
high=float(max(distance))
low=float(min(distance))
print (list)
print ("The furthest distance is: " + high)
print ("The shorest distance is: " + low)
我得到错误'浮动'对象不可迭代。我很好奇我做错了什么,如果我在编写这段代码的时候完全不了解。浮点对象不可迭代
你期望'max(distance)'做什么?你给它提供了一个单一的号码......你认为它会告诉你这个号码是什么? 'min(distance)'相同。 – kindall