Skip to content
Programming101
Programmingoneonone
  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programmingoneonone

HackerRank Any or All problem solution in python

YASH PAL, 31 July 2024

In this Any or All problem, You are given a space-separated list of integers. If all the integers are positive, then you need to check if an integer is a palindromic integer.

HackerRank Any or All solution in python

Problem solution in Python 2 programming.

# Enter your code here. Read input from STDIN. Print output to STDOUT
def is_pal(n):
    S=str(n)
    return all((s==t for s,t in zip(S,reversed(S))))
def meets_conditions(L):
    if not all((l>0 for l in L)):
        return False
    return bool(any((is_pal(l) for l in L)))

N=int(raw_input())
L=map(int, raw_input().split())
print meets_conditions(L)

Problem solution in Python 3 programming.

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

Problem solution in pypy programming.

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

Problem solution in pypy3 programming.

# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())
a = list(input().split())
if all(int(x)>0 for x in a) and any(x ==x[::-1] for x in a):
    print ('True')
else: 
    print('False')

coding problems solutions Python Solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Programing Practice

  • C Programs
  • java Programs

HackerRank Solutions

  • C
  • C++
  • Java
  • Python
  • Algorithm

Other

  • Leetcode Solutions
  • Interview Preparation

Programming Tutorials

  • DSA
  • C

CS Subjects

  • Digital Communication
  • Human Values
  • Internet Of Things
  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes