#isinstance()的运用 #练习: 求值总和以及平均值. str_list = [1,2,3,4,5,6,'a',7,8,9,'b',10,'c'] my_tal = 0 my_var = 0 for i in str_list: #这里通过isinstance()函数来筛选int值和float值 if isinstance(i,int) or isinstance(i,float): my_tal += i #通过my_var来计算平均值 my_var += 1 print('总和:'…