Geek Culture
Published in

Geek Culture

Permutations in Python

Using the itertools module

Photo by Jean-Louis Paulin on Unsplash

The itertools.permutations function accepts a single iterable and creates every possible permutation of input values.

What are permutations

If we have a set of distinct values, for example the set of letters A, B, C, and D, there are different ways we can arrange those items. For example ABCD, CADB, or DCBA. Each unique arrangement…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Martin McBride

Martin McBride

247 Followers

Freelance software consultant, developer, technical author. Java, Python. martinmcbride.org