python如何让用户直接输入作为实参保存到函数里
#打印的函数defprint_models(unprint_designs,completed_models):#模拟打印每个设计,直到没有未打印的设计为止#打印每个设计...
#打印的函数
def print_models(unprint_designs, completed_models):
#模拟打印每个设计,直到没有未打印的设计为止
#打印每个设计后,都将其移到列表completed_models中
while unprint_designs:
current_designs = unprint_designs.pop()
#模拟根据设计制作3D打印模型的过程
print('\nPrinting model: ' + current_designs)
completed_models.append(current_designs)
#创建显示的函数
def show_completed_models(completed_models):
#显示打印好的所有模型
print('\nThe follwoing models have been printed:')
for completed_model in completed_models:
print(completed_model)
#给函数赋值
unprint_designs = ['iphone','sun','fox']
completed_models = []
print_models(unprint_designs, completed_models)
show_completed_models(completed_models) 展开
def print_models(unprint_designs, completed_models):
#模拟打印每个设计,直到没有未打印的设计为止
#打印每个设计后,都将其移到列表completed_models中
while unprint_designs:
current_designs = unprint_designs.pop()
#模拟根据设计制作3D打印模型的过程
print('\nPrinting model: ' + current_designs)
completed_models.append(current_designs)
#创建显示的函数
def show_completed_models(completed_models):
#显示打印好的所有模型
print('\nThe follwoing models have been printed:')
for completed_model in completed_models:
print(completed_model)
#给函数赋值
unprint_designs = ['iphone','sun','fox']
completed_models = []
print_models(unprint_designs, completed_models)
show_completed_models(completed_models) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询