Answered by AI, Verified by Human Experts
Your code correctly prompts the user for the number of names they have and then uses a for loop to collect their names and store them in the variable "fullname". However, you will have to do some adjustments to print each of the user's names as their first name, middle name(s), and last name.One way to do this is to store each name as an element in a list and then use list slicing to access the first, middle, and last elements. Here's an example of how you can modify your code to achieve this:names = int(input("how many names do you have: "))name_list = []for i in range (names):cheese = input("what is your name: ")name_list.append(cheese)print("First name: " + name_list[0])print("Middle names: " + " ".join(name_list[1:-1]))print("Last name: " + name_list[-1])In this example, the input names are stored in a list called name_list. By using list slicing and the join() method you can print each part of the name separately....