Home>

Learning Python and write a program to check the contents of the letters in the text. There is such a code:

Import String
MyText= Input ("Enter text to check:")
N= INPUT ("Enter the letters to search:")
N= N.REPLACE ("", "")
SYMBS= LIST (N)
Print ("We are looking for such letters:", SYMBS)
For S in Symbs:
    IF S in MyText:
        Print ("The text is the letter '" + S + "')
        Break
    ELSE:
        Print ("In the text there is no letter '" + s + "'")
ELSE:
    Print ("There are no such letters in the text")
Print ("Search Completed")

For example: "Hello my name is Oleg" is the text for checking, and the letters "P, P, and, B, E, T" are the desired. In this case, the result of the program will be:

Enter the text for checking: Hello my name is Oleg
Enter the letters to search: Hi
We are looking for such letters: ['p', 'r', 'and', 'in', 'e', ​​'t']
The text has the letter 'P'
Search completion

How to make so that all the letters found were displayed