50.9k views
3 votes
write a program that reads a character, then reads in a list of words. the output of the program is every word in the list that contains the character at least once. assume at least one word in the list will contain the given character.

1 Answer

2 votes

Answer:

Refer to the code below

Step-by-step explanation:

# Input character and words

char = input()

words = input()

# Splitting the words as an array

words = words.split()

# Traverse over the array to see if the character is present in a word

for word in words:

if char in word:

print(word)

User Jon Wingfield
by
3.8k points