def location_description():
'''given the user input for s number of locations, creates s amount of lines to describe each location'''
location_num = int(num_locations())
for x in range(location_num):
input()
def location_description():
'''given the user input for s number of locations, creates s amount of lines to describe each location'''
location_num = int(num_locations())
lines = []
for x in range(location_num):
lines.append(input())
return lines
可以从输入行生成列表:
只需确保将输入附加到返回的列表中:
相关问题 更多 >
编程相关推荐