jmpark0118 / CODING_TEST_PRACTICE

0 stars 0 forks source link

Practice>Python>Built-Ins>Any or All #94

Open jmpark0118 opened 3 years ago

jmpark0118 commented 3 years ago

image image

출처 : https://www.hackerrank.com/challenges/any-or-all/problem

jmpark0118 commented 3 years ago

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    print(all([all([l[i]>0 for i in range(n)]), any([str(l[i])==str(l[i])[::-1] for i in range(n)])]))
jmpark0118 commented 3 years ago

if __name__ == '__main__':
    n, l = int(input()), list(input().split())
    print(all([int(l[i])>0 for i in range(n)]) and any([l[i]==l[i][::-1] for i in range(n)]))