Question: * This Python Code needs to be put into RAPTOR program * # # Function to categorize trainers based on the number of new enrollees

*This Python Code needs to be put into RAPTOR program*
# # Function to categorize trainers based on the number of new enrollees
def categorize_trainers(enrollees):
category_counts =[0,0,0] # Initialize counts for each category
for count in enrollees:
if count <=5:
category_counts[0]+=1 # Increment count for 0-5 category
elif count <=10:
category_counts[1]+=1 # Increment count for 6-10 category
else:
category_counts[2]+=1 # Increment count for 11-15 category
return category_counts
# Main program
def main():
trainers =[] # List to store trainers' last names
enrollees =[] # List to store the number of new enrollees for each trainer
# Input loop to gather trainers' last names and the number of new enrollees
for i in range(15):
trainer_name = input("Enter trainer's last name: ")
new_enrollees = int(input("Enter the number of new enrollees: "))
trainers.append(trainer_name)
enrollees.append(new_enrollees)
# Categorize the trainers based on the number of new enrollees
category_counts = categorize_trainers(enrollees)
# Output the number of trainers in each category
print("Number of trainers with 0-5 new members:", category_counts[0])
print("Number of trainers with 6-10 new members:", category_counts[1])
print("Number of trainers with 11-15 new members:", category_counts[2])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!