Display different combinations of letters from dictionary values.

In this python dictionary program, we will display different combinations of letters from dictionary values.

Steps to solve the program
				
					import itertools      
d ={'x':['e','f'],'y':['a','b']}

for combi in itertools.product(*[d[char] for char in sorted(d.keys())]):
    print(''.join(combi))
				
			

Output :

				
					ea
eb
fa
fb
				
			

print all the unique values in a dictionary.

create a dictionary from a string.

Leave a Comment