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.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. Practice
  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 →

  • aa1992HackerRank Admin 6 years ago+ 0 comments

    nice solution. But instead of range[0,x] you could do

    print ([[a,b,c] for a in range(x+1) for b in range(y+1) for c in range(z+1) if a + b + c != n ])
    
    71|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature