Sort by

recency

|

750 Discussions

|

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

    I will just say that the explanation of problem wasn't coherent... like there was no mention of "ANY" number in list is palindrome but gave 5 is palindromic number... i wasted so much time clearing all TEST CASES when the answer was right in front of me

  • + 0 comments

    n1, n2=input(),input().split() print(all([int(i) > 0 for i in n2]) and any([j == j[::-1] for j in n2]))

  • + 0 comments

    if any([x for x in y] == [x for x in y][::-1] for y in int_list)

    Explanation: x for x in y makes a list if digits from the y [::-1] reverses that list. We check the equality between the two to determine palidromality (a word I made up) for y in int_list breaks the int_list up into individual strings to check.

    In thise case, just leave the input as a string for simplicity.

  • + 0 comments

    Here is HackerRank Any or All in Python solution - https://programmingoneonone.com/hackerrank-any-or-all-problem-solution-in-python.html