def finished_projects(unfinished_projects, completed_projects):
while unfinished_projects:
current_project = unfinished_projects.pop()
print('completing project: ' + current_project)
completed_projects.append(current_project)
def show_completed_projects(completed_projects):
print('\nThese projects have been completed:')
for project in completed_projects:
print(project)
unfinished_projects = ['pie-chart', 'bar graph', 'line chart']
completed_projects = []
print(finished_projects(unfinished_projects,completed_projects))
print(show_completed_projects(completed_projects))
Tags:
这是因为您正试图打印两个函数的返回值,而这两个函数都没有,请尝试执行以下操作:
调用函数时,不要添加打印。只需调用函数即可
如果您返回一些内容,则可以使用打印
相关问题 更多 >
编程相关推荐