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

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Basic Data Types
  4. List Comprehensions
  5. Discussions

List Comprehensions

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

Sort 1442 Discussions, By:

recency

Please Login in order to post a comment

  • patelpalak194
    1 week ago+ 1 comment

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input()) moba = [[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(moba)

    -4|
    Permalink
  • tanvisharma2742
    1 week ago+ 0 comments

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input()) new_list=[[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(new_list)

    0|
    Permalink
  • annmail0101
    2 weeks ago+ 1 comment

    x, y, z, n = (int(input()) for _ in range(4))

    array = [[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(array)

    0|
    Permalink
  • nayand2809
    2 weeks ago+ 0 comments

    i dont understand the question please help me

    5|
    Permalink
  • ruminadudekula
    2 weeks ago+ 0 comments

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input()) lists=[] for i in range(x+1): for j in range(y+1): for k in range(z+1): new_list=[i, j, k] lists.append(new_list)

    neww_list = [list(k) for k in lists if sum(k) != n]    
    print(neww_list)
    
    0|
    Permalink
Load more conversations

Need Help?


View tutorial
View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy