The code below will allow a user to enter a specified number of people to a list. Each person has three attributes: name, sex, and age. The code should count the number of 'm' characters in the list and count the number of 'f' characters in the list but gives an error when you get to the count lines. How would I fix this issue?
list1 = []
person = dict()
n = int(input("Enter number of elements: "))
for i in range(0, n):
print ("Enter information :")
person[i] = input("Enter name: "), input("Enter sex (m or f): "), input("Enter age: ")
list1.append(person[i])
i = i + 1
print (list1)
print ("Number of males = " + list1.count('m'))
print ("Number of females = " + list1.count('f'))