""" Write a program that randomly generates a list of integers of size 10. Range of integers will be between -10 and 10. The program finds the average of even numbers and average of odd numbers """ import random def main(): my_list=[] for i in range(10): my_list.append(random.randint(-10,10)) print(my_list) sum_even=0 count_even=0 sum_odd=0 count_odd=0 for i in range(10): if(my_list[i]%2==0): sum_even=sum_even+my_list[i] #sum_even+=my_list[i] count_even=count_even+1 #count_even+=1 else: sum_odd=sum_odd+my_list[i] count_odd=count_odd+1 if(count_even>0): print("average evens is",sum_even/count_even) else: print("evens") if(count_odd>0): print("average odd is",sum_odd/count_odd) else: print("no odds") main()