Answer:
count = 0
months = 0
years = int(input("Enter the number of years: "))
for year in range(1, years+1):
cars_sold = int(input("Enter the number of cars sold in first six months: "))
count += cars_sold
months += 6
print("Number of months: " + str(months))
print("Number of cars sold in total: " + str(count))
print("Average number of cars sold per month: " + str(count / months))
Step-by-step explanation:
Initialize the variables
Ask the user for the number of years
Create a for loop that iterates depending on the given number of years
Ask the user for the number of cars sold in the first six months of the year
Increment the count by given number and increment the months by 6 after each iteration
Print the months, count and, average