#lecture practice - Community Center question import random def make_list_random(size, min_limit, max_limit): my_list=[] for i in range(size): n=random.randint(min_limit, max_limit) my_list.append(n) return my_list def make_list_string(size): #this function creates a list of strings from user input my_list=[] for i in range(size): name=input("enter string ") my_list.append(name) return my_list def main(): #Part I: creating list of activity names size=int(input("enter number of activities ")) activity_names=make_list_string(size) print(activity_names) #Part II: generating list of hours and list of calories burn #per 1 hour hours=make_list_random(size, 0,5) print("hours are", hours) calories=make_list_random(size, 0, 800) print("calories per hour", calories) #part III: The program creates a new list - total_calories. #Each entry in the list is the total number of calories burnt #per week per activity. total_calories=[0]*size print("total calories BEFORE calculations", total_calories) for i in range(size): total_calories[i]=hours[i]*calories[i] print("total calories", total_calories) #part IV: The program finds the activity with minimal #number of calories burnt per week. min_calories=min(total_calories) print("minimum calories", min_calories) min_index=total_calories.index(min_calories) print("index of the minimal value in the list is", min_index) print("activity with minimum calories is", activity_names[min_index]) main()