Sort by

recency

|

1698 Discussions

|

  • + 0 comments

    run after changing the language to Pypy 3

    if name == 'main': n = int(input()) integer_list = map(int, input().split()) t=tuple(integer_list) print(hash(t))

  • + 0 comments
    if __name__ == '__main__':
        n = int(input())
        l = tuple(map(int, input().split()))
        tuple_hash = hash(l)
        print(tuple_hash)
    

    note implement in Pypy3

  • + 0 comments

    I solve this way : n = int(input()) elements = input().split()

    if len(elements) == n:
        t = tuple(map(int, elements))
        print(hash(t))
    else:
        print("Error: The number of elements does not match the expected value.")
    
  • + 3 comments

    Does anyone get the hash ((1,2)) equal to the suggested output? I tried on PyCharm and W3 Editor, But both gave a different output (-3550055125485641917).

    Can anyone help to clarify to which we need to apply hash()?

  • + 3 comments

    Only seems to work in Pypy:

    n = int(input()) elements = tuple(map(int, input().split())) print(hash(elements))