Sort by

recency

|

745 Discussions

|

  • + 0 comments

    n , arr = int(input()) , input().split() print(all(int(x)>0 for x in arr) and any(x == x[::-1] for x in arr))

  • + 0 comments

    Here's what I used:

    N = int(input())
    arr = list(map(int,input().split()))
    
    print(all(i>0 for i in arr) and any(str(i)[::-1]==str(i) for i in arr))
    
  • + 0 comments

    pyp3 answer

    N=int(input()) li=list(map(int,input().split(" "))) if (all(i>0 for i in li)==True) and (any(str(i)[::-1]==str(i) for i in li)==True): print(True) else: print(False)

  • + 0 comments

    n = input() number_list = tuple(map(int, input().split())) print(all(number>=0 for number in number_list) and any(str(number) == str(number)[::-1] for number in number_list))

  • + 1 comment

    How come input 1 and 81 test case returns False, 81 is postive number and 1 is palindrome then it supposed to return True. My test case is failing as expected output is False for the above input 1 and 81 but my program returns True. Any suggestions?

    • + 0 comments

      The task description is confusing! To be True, ALL numbers must be positive, plus AT LEAST ONE (i.e. any()) number must be palindromic. The example demonstrates it better, but it's still not the clearest or easiest to follow. I initially read it that it didn't require all numbers to be positive, just that any positive numbers were all palindromic.