Skip to content

How to find permutation of three numbers in Python list?

if __name__ == '__main__':
    x = int(input())+1
    y = int(input())+1
    z = int(input())+1
    n = int(input())
    variable = []
    for i in range(0,x):
        for j in range(0,y):
            for k in range(0,z):
                if ( i+j+k) != n:
                    variable.append([i, j, k])
print(variable)
See also  How to make a set of math questions in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.