It is necessary to get such a condition:

If the list has at least one letter print "Please enter a number!"

Closed due to the fact that off-topic participants MarianD , 0xdb , cheops , Eugene Krivenja , insolor Aug 7 '18 at 11:25 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Learning tasks are allowed as questions only on the condition that you tried to solve them yourself before asking a question . Please edit the question and indicate what caused you difficulties in solving the problem. For example, give the code you wrote, trying to solve the problem "- MarianD, 0xdb, cheops, Eugene Krivenja, insolor
If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    def has_letter(items): return any(c.isalpha() for c in items) # Более привычный алгоритм: # def has_letter(items): # for c in items: # if c.isalpha(): # return True # # return False items = ['1', '3', '4'] print(has_letter(items)) # False items = ['у', '1', '3', '4'] print(has_letter(items)) # True items = ['f', '1', '3', '4'] print(has_letter(items)) # True 

     items = ['у', '1', '3', '4'] if has_letter(items): print("Пожалуйста введите цифру!") 
    • It is interesting who walked the minusket on this page and why :) The answer is correct, it corresponds to the question. - gil9red
    • this is clearly a learning task - Andrio Skur
    • one
      @AndrioSkur, what is the connection between a question - a learning task and a minus answer? - insolor
    • one
      @AndrioSkur, this site is also needed for asking questions and giving answers. What are your bad answers to learning tasks? - gil9red
    • one
      @AndrioSkur, what are you saying, I didn’t ask about the question. You made it clear that minus the answer to the question about the training task is possible (and perhaps you put a minus, but it is not important). So I wonder why you think so? Kst, here's a discussion on these kinds of answers to similar questions: ru.meta.stackoverflow.com/a/233/201445 - gil9red
     num = None for letter in list: if letter.isalpha(): num = input("Пожалуйста введите цифру") break 

    Further address to num , there value which you will enter into the console will be written.

    In case you do not need to store / use the entered digit further, you just need to print the message to the console: replace num = input("Пожалуйста введите цифру") with print("Пожалуйста введите цифру") and delete the first line ( num = None ).