• + 2 comments

    There is nothing special about it, the code is not very efficient. - looking at the prettiness of the code, I would say it's around decent - pretty. It's very readable, and understandable. Compared to this s*** for instance: (I didn't write it)

    print("{:6f}\n{:6f}\n{:6f}".format(len(list(filter(lambda x:x>0,arr)))/len(arr),len(list(filter(lambda x:x<0 , arr)))/len(arr),len(list(filter(lambda x:x==0,arr)))/len(arr)))
    

    This was my solution:

    n = int(input())
    arr = [int(x) for x in input().split()]
    
    positive = 0
    negative = 0
    zeroes = 0
    
    for i in arr:
        if i > 0:
            positive += 1
        elif i < 0:
            negative += 1
        else:
            zeroes += 1
    
    Length = len(arr)
    print(positive/Length)
    print(negative/Length)
    print(zeroes/Length)
    

    the best possible performance, and it's easy to read, and just looks overall pretty.