Advertisement
SimeonTs

SUPyF Lists - Extra 01. Array Contains Element

Jun 15th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. """
  2. Lists
  3. Check your answer: https://judge.softuni.bg/Contests/Practice/Index/426#0
  4.  
  5. 01. Array Contains Element
  6.  
  7. Problem:
  8. Read a list of integers on the first line of the console and an integer N from the second line of the console and print
  9. whether the item is contained in the list. If it is, print β€œyes”, otherwise print β€œno”.
  10. Examples:
  11. Input:                 
  12. 1 2 3 4 5
  13. 5                      
  14. Output: yes
  15.  
  16. Input: 
  17. 8 7 7 9 6 2 2
  18. 11                     
  19. Output: no
  20. """
  21. nums = [int(item) for item in input().split(" ")]
  22. num = int(input())
  23.  
  24. if num in nums:
  25.     print("yes")
  26. else:
  27.     print("no")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement