You are viewing a single comment's thread. Return to all comments →

print ([[a,b,c] for a in range(0,x+1) for b in range(0,y+1) for c in range(0,z+1) if a + b + c != n ])

sir can you explain this line

@rnamaye this line print the value of a,b,c from 0 to x+1 , y+1 ,z+1 respectively if the sum (a+b+c) is not equal to the n

okay sir and one more doubt regarding to that only (a+b+c) !=n

## List Comprehensions

You are viewing a single comment's thread. Return to all comments →

print ([[a,b,c] for a in range(0,x+1) for b in range(0,y+1) for c in range(0,z+1) if a + b + c != n ])

sir can you explain this line

@rnamaye this line print the value of a,b,c from 0 to x+1 , y+1 ,z+1 respectively if the sum (a+b+c) is not equal to the n

okay sir and one more doubt regarding to that only (a+b+c) !=n