students = ["a bunch of student names I will not show"]
students.sort(key=len)
shortest_name = (students[0])
print ("The shortest name is ,", shortest_name)
正如您在string (not list of strings)中询问的最短名称。变更最小的工作代码为:
students = "a bunch of student names I will not show"
students = sorted(students.split(), key=len)
shortest_name = students[0]
print("The shortest name is ,", shortest_name)
正如您在
string (not list of strings)
中询问的最短名称。变更最小的工作代码为:相关问题 更多 >
编程相关推荐