Sort by

recency

|

1786 Discussions

|

  • + 0 comments

    Don't use Python 3 for this problem. Use Python 2.

  • + 0 comments

    "Vintage fashion is making a huge comeback, and I love how classic pieces never go out of style."Trapstar

  • + 1 comment
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n = int(input())
    # I don't get what is the point of the n if the input that we are looking for is one liner?
    # Ofc you could add a checker if the the count of int elements of tuple corresponds to n.
    
    
    # BTW the version of Python influences the hash function so if you get
    # -35513421 or whatever you did it correct the first time. 
    t = tuple(map(int, input().split()))
    # print(t)
    print(hash(t))
    
    • + 0 comments

      same for me too for this code { a = int(input()) b = tuple(map(int,input('').split(' '))) print(hash(b)) } i am actually getting {-35513421..} I am asking because i was still confused with the test cases.

  • + 0 comments

    Yeah. I've found the same thing - the most logical scripting seems to work with python 2 but not python 3, with the test cases. It does seem likely a hackerrank problem.

    from future import print_function # Ensures print is a function, for Python 2 compatibility if name == 'main': n = int(input()) integer_list = map(int, raw_input().split())

    print(hash(tuple(integer_list)));
    
  • + 0 comments
    n = int(input())
    integer_list = map(int, input().split())
    t=tuple(integer_list)
    print(hash(t))