diff --git a/Python/Module2_EssentialsOfPython/Problems/EncodeAsString.md b/Python/Module2_EssentialsOfPython/Problems/EncodeAsString.md index 520a523a..7cc01170 100644 --- a/Python/Module2_EssentialsOfPython/Problems/EncodeAsString.md +++ b/Python/Module2_EssentialsOfPython/Problems/EncodeAsString.md @@ -96,6 +96,8 @@ is equivalent to the long-form code: out = "" for x in some_iterable_of_strings: out += "" + x + +out = out.lstrip("") # get rid of the extra leading "" ``` `int_to_str` plays a clever trick to convert each integer, digit-by-digit, into its string form - it calls `str` on the integer. This converts the integer into a string, which is a [sequence](https://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/SequenceTypes.html). This permits us to access each digit of the integer and even iterate over them: