HackerRank Python - Any or All

This expression returns True if any element of the iterable is true.
If the iterable is empty, it will return False.

  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. _ = input()
  3. n = input().split()
  4. print(all([int(i) > 0 for i in n]) and any([j == j[::-1] for j in n]))


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube