def show_physicist(names_list):
print(names_list.title())
physicist_names = [‘einstein’,‘newton’,‘hawking’]
show_physicist(physicist_names)
AttributeError:‘list’ object has no attritube title
修改后的代码
def show_physicist(names_list):
print(str(names_list).title())
physicist_names = [‘einstein’,‘newton’,‘hawking’]
show_physicist(physicist_names)