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.
List Comprehensions
List Comprehensions
Sort by
recency
|
1844 Discussions
|
Please Login in order to post a comment
But i dont really understand why we made range(x+1) and so on?
don't forget about itertools in python, it's tremendously powerful:
if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input())
hii guys i want to know from where i can learn python becoz i have alredy studied python in 12th but i am stilln not able to solve ques like this
Simple Solution ...
x = int(input())
y = int(input())
z = int(input())
n = int(input())
l = []
for i in range(0,x+1): for j in range(0,y+1): for k in range(0,z+1): if(i+j+k)!=n: l.append([i,j,k]) print(l)