We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Python
  3. Basic Data Types
  4. List Comprehensions
  5. Discussions

List Comprehensions

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

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

  • gkeswani92
    7 years ago+ 102 comments
    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 ])
    
    531|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature