def show_magicians(magicians): for magician in magicians: print(magician) def make_great(magicians): great_magicians = [] while magicians: new_magician = magicians.pop() great_magician = "the great " + new_magician great_magicians.append(great_magician) print(great_magicians) magician_list = ['ada1', 'jack1', 'mai1','tom1'] check_great = make_great(magician_list) #print(check_great) show_magicians(check_great)
TypeError: 'NoneType' object is not iterable
为什么会报错?
为什么print(check_great)会返回none?
make_great生成的列表为什么无法赋值给到check_great?
我的目的是调用show_magicians函数打印出make_great函数生成的列表,应该怎样实现呢?
慕后端443704
相关分类