Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. For coding simplicity, follow each output word by a comma, even the last one. Add a newline to the end of the last output. Assume at least one word in the list will contain the given character. Assume that the list of words will always contain fewer than 20 words.

Respuesta :

The program is an illustration of lists

What are lists?

Lists are variables that are used to hold multiple values

The main program

The program written in Python, where comments are used to explain each line is as follows:

#This gets the integer

n = int(input())

#This gets the character

char = input()[0]

#This creates an empty list

MyList = []

#This following loop gets input for the list

for i in range(n):

   MyList.append(input())

#This iterates through the list    

for items in MyList:

   #This checks if the character is in a list element

   if char in items:

       #If yes, the element is printed

       print(items,end =", ")

Read more about lists at:

https://brainly.com/question/24833629

ACCESS MORE