Sort by

recency

|

1827 Discussions

|

  • + 0 comments

    if name == 'main':

    def Action(x,y,z,n):
        result = []
        output = []
        for i in range(x+1):
            for j in range(y+1):
                for k in range(z+1):
                    if i+j+k != n:    
                        result = [i,j,k]
                        output.append(result)
        return output
    
    x = int(input())
    y = int(input())
    z = int(input())
    n = int(input())
    
    print(Action(x,y,z,n))
    
  • + 0 comments

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input()) l = [[i,j,k]for i in range(x+1) for j in range(y+1) for k in range(z+1) if i+j+k != n] print(l)

  • + 0 comments

    Hackerrank is the best platform. The discussions help deepen understanding—perfect for beginners and those brushing up their skills. Dentist Saskatoon

  • + 0 comments

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input())

    result = [
        [i, j, k]
        for i in range(x + 1)
        for j in range(y + 1)
        for k in range(z + 1)
        if i + j + k != n
    ]
    
    print(result)
    
  • + 1 comment

    for i1 in range(x+1): for i2 in range(y+1): for i3 in range(z+1):
    if i1+i2+i3!=n: list.append([i1,i2,i3]) list=[ i for i in list if sum(i)!=n]

                    print(list) 
    

    what is the mistake in here?