You are viewing a single comment's thread. Return to all comments →
why isnt my code running successfully whereas other compilers give the answers correct
from itertools import product def solve(x,y,z,n): coor = [0, x] possible_combi = list(product(coor, repeat=3)) newlist = [combo for combo in possible_combi if sum(combo) != n] for combo in newlist: print(combo) if __name__ == '__main__': x = int(input()) y = int(input()) z = int(input()) n = int(input()) solve(x,y,z,n)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
why isnt my code running successfully whereas other compilers give the answers correct