return和print的区别
2:问题2:def average(*args): if len(args)==0: print 0 print sum(args)/(len(args) print average() print average(1, 2) print average(1, 2, 2, 3, 4) 若将return换成print就会报错(zerodivisionerror),请问下,return和print有什么区别
2:问题2:def average(*args): if len(args)==0: print 0 print sum(args)/(len(args) print average() print average(1, 2) print average(1, 2, 2, 3, 4) 若将return换成print就会报错(zerodivisionerror),请问下,return和print有什么区别
2017-10-13
举报