generate functionMon, 20 Mar 2023

On the first line, one character is entered - a lowercase letter. The sentence is entered on the second line. Output It is necessary to output a list of words (a word is a part of a sentence surrounded by white space characters) in which the entered letter is present in any case, in the same order in which they occur in the sentence.

letter = input() sentence = input() sentence_list = sentence.split() for word in sentence_list: for c in word: if c.upper() == letter.upper(): print(word) break

Questions about programming?Chat with your personal AI assistant