all_any.py 760 B

12345678910111213141516171819202122232425262728293031323334
  1. def test_1():
  2. a = ['sfd', 'werwer', '']
  3. print(all(a))
  4. print(any(a))
  5. # test_1()
  6. def test_2():
  7. words = ['notice', 'deter', 'west', 'brush', 'stadium',
  8. 'package', 'price', 'clothes', 'sword', 'apology']
  9. check = [len(word) >= 4 for word in words]
  10. print(check)
  11. print(all(check))
  12. print(all([len(word) > 4 for word in words]))
  13. print(any([len(word) > 7 for word in words]))
  14. print(any([len(word) >= 7 for word in words]))
  15. # test_2()
  16. def test_3():
  17. words = list(input().split(' '))
  18. print(all(['A' in word or 'a' in word for word in words]))
  19. # test_3()
  20. def test_4():
  21. my = input().lower().split()
  22. print(any([word.endswith('ought') for word in my]))
  23. # test_4()