Permutation and Combination || Python

 

In this we are going to see a program on how to calculate Union and Intersection of Two Sorted Arrays || Python in Python Programming Language.


from itertools import permutations, combinations

l = [7,8,9]

comb = combinations(l,2)
perm = permutations(l)
print("Permutations - ")
for i in perm:
    print(i,end=", ")

print("\n")
print("Combinations - ")
for i in comb:
    print(i,end=", ")

# Coded by Saahil

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post