Python编程从入门到实践_8-11 不变的魔术师_答案

Python编程从入门到实践_8-11 不变的魔术师_答案

#8-12 qs 2020_08_06

def show_magicians(s_names):
	for name in s_names:
		print(name)
		
def make_great(names,made_names):
	while names:
		name = names.pop()
		name = 'the Great ' + ' ' + name
		made_names.append(name)
			
names = ['a','b','c','d','e','f','g']
made_names = []

print('**********make_great()函数处理前:**********')
print('**********names列表**********')
show_magicians(names)
print('**********made_names列表**********')
show_magicians(made_names) 

make_great(names[:],made_names)

print('**********make_great()函数处理后:**********')
print('**********names列表**********')
show_magicians(names)
print('**********made_names列表**********')
show_magicians(made_names)

 

你可能感兴趣的:(python)