Python: Find all lower and upper mixed case combinations of a given string
Write a Python program to find all lower and upper mixed case combinations of a given string.
Sample Solution:
Python Code:
Sample Output:
Original string: abc All lower and upper mixed case combinations of the said string: ['abc', 'abC', 'aBc', 'aBC', 'Abc', 'AbC', 'ABc', 'ABC'] Original string: w3r All lower and upper mixed case combinations of the said string: ['w3r', 'w3R', 'w3r', 'w3R', 'W3r', 'W3R', 'W3r', 'W3R'] Original string: Python All lower and upper mixed case combinations of the said string: ['python', 'pythoN', 'pythOn', 'pythON', 'pytHon', 'pytHoN', 'pytHOn', 'pytHON', 'pyThon', 'pyThoN', 'pyThOn', 'pyThON', 'pyTHon', 'pyTHoN', 'pyTHOn', 'pyTHON', 'pYthon', 'pYthoN', 'pYthOn', 'pYthON', 'pYtHon', 'pYtHoN', 'pYtHOn', 'pYtHON', 'pYThon', 'pYThoN', 'pYThOn', 'pYThON', 'pYTHon', 'pYTHoN', 'pYTHOn', 'pYTHON', 'Python', 'PythoN', 'PythOn', 'PythON', 'PytHon', 'PytHoN', 'PytHOn', 'PytHON', 'PyThon', 'PyThoN', 'PyThOn', 'PyThON', 'PyTHon', 'PyTHoN', 'PyTHOn', 'PyTHON', 'PYthon', 'PYthoN', 'PYthOn', 'PYthON', 'PYtHon', 'PYtHoN', 'PYtHOn', 'PYtHON', 'PYThon', 'PYThoN', 'PYThOn', 'PYThON', 'PYTHon', 'PYTHoN', 'PYTHOn', 'PYTHON']
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Python program to split a given list into specified sized chunks using itertools module.
Next: Write a Python program to create group of similar items of a given list.What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics