Any or All Hackerrank Solution Python
For Explanation Watch Video :
Code:
siz = int(input())
lst = list(input().split())
pos = all([int(i)>0 for i in lst])
pal = any([st == st[::-1] for st in lst])
print(pos and pal)#true
Code:
siz = int(input())
lst = list(input().split())
pos = all([int(i)>0 for i in lst])
pal = any([st == st[::-1] for st in lst])
print(pos and pal)#true
Comments
Post a Comment