Sort by

recency

|

1754 Discussions

|

  • + 0 comments

    "I can tell you put a lot of time into researching this, thank you!"

    travis scott merch

  • + 0 comments

    Try this in pypy3

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

  • + 0 comments

    For python users using hash(tuple):

    The issue you're encountering isn't with your logic but rather with the behavior of Python's hash() function. The output of hash() in Python can vary between runs or environments due to Python's hash randomization feature. This is a security feature introduced to prevent certain types of attacks.

  • + 2 comments

    my code is :

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

    But this code giving me the wrong answer.. Why?? Can anyone tell.??

  • + 1 comment

    In google colab, this code runs excatly as expected but I don't know how do I take the integer inputs given in single line separated by 'space'. Please tell me how do I take such inputs given in single line.

    n = int(input())
    temp_l = []
        
    for _ in range(n):
      num = int(input())
      temp_l.append(num)
    
    temp_tup = tuple(temp_l)  
    print(hash(temp_tup))