Find all upper, lower and mixed case combinations of a string

import itertools

s="Fox"
map(''.join, itertools.product(*zip(s.upper(), s.lower())))
>>> ['FOX', 'FOx', 'FoX', 'Fox', 'fOX', 'fOx', 'foX', 'fox']

Leave a Comment