vendredi 20 novembre 2020

Replace a particular letter character from a string (which contains a line from a file) to a desired digit

I imported a 1 line desired coin flip outcome (HTTH) into a string successfully and want to convert the H's in my string to 1's and the T's in my string to 0's. What would be the most efficient way to do this? It will eventually be pushed into its own list container.

Aucun commentaire:

Enregistrer un commentaire