Відповідь:
# Initializing the variables
total_men = 0
# Iterating through the given data
for i in range(5):
age = input("Enter the age of the person: ")
gender = input("Enter the gender of the person (male/female): ")
if gender == "male":
total_men += 1
# Printing the result
print("The total number of men is:", total_men)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Відповідь:
# Initializing the variables
total_men = 0
# Iterating through the given data
for i in range(5):
age = input("Enter the age of the person: ")
gender = input("Enter the gender of the person (male/female): ")
if gender == "male":
total_men += 1
# Printing the result
print("The total number of men is:", total_men)