【python】第八次课作业

2019-04-15 13:06发布

8-3 8-4def make_shirt(size = 'XXL', pic = 'I love Python'): print("Your shirt is " + size + ", with picture '" + pic + "'.") make_shirt('M', 'COOL') make_shirt(pic = 'My T', size = 'S') make_shirt() make_shirt('XL')8-9 8-10 8-11magicians = ['Leo', 'Nemo', 'Karry', 'Roy', 'Lucky'] def show_magicians(magicians): for magician in magicians: print(magician) def make_great(magicians): for i in range(len(magicians)): magicians[i] = 'the Great ' + magicians[i] return magicians show_magicians(magicians) new_list = make_great(magicians[:]) show_magicians(new_list) show_magicians(magicians)

8-14def make_car(manu, typ, **info): return 'call successful' car = make_car('subaru', 'outback', color='blue', tow_packge=True) print(car)8-16import my_fun my_fun.fun() from my_fun import fun fun() from my_fun import fun as fn fn() import my_fun as mn mn.fun() from my_fun import * fn()