mercredi 25 avril 2018

Python script to make every combination of a string with placed characters

I'm looking for help in creating a script to add periods to a string in every place but first and last, using as many periods as needed to create as many combinations as possible:

The output for the string "1234" would be:

["1234","1.234","12.34","123.4","1.2.34","1.23.4" etc. ]

And obviously this needs to work for all lengths of string.




Aucun commentaire:

Enregistrer un commentaire