Skip to content

Instantly share code, notes, and snippets.

@abhinavkorpal
Created April 8, 2017 07:18
Show Gist options
  • Save abhinavkorpal/4b7237b1cf30bd73c93434b041d5564b to your computer and use it in GitHub Desktop.
Save abhinavkorpal/4b7237b1cf30bd73c93434b041d5564b to your computer and use it in GitHub Desktop.
List Comprehensions
if __name__ == '__main__':
x, y, z, n = int(input()), int(input()), int(input()), int(input())
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 ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment