Apr-15-2019, 10:16 AM
You are right, strings in Python are immutable, so you can't append to it.
Two options come in mind - create new string with every iteration of loop or append to data structure which is mutable and at the end convert to string.
I just pinpoint that your lett is not empty string:
Two options come in mind - create new string with every iteration of loop or append to data structure which is mutable and at the end convert to string.
I just pinpoint that your lett is not empty string:
>>> lett = ' ' >>> len(lett) 1 >>> ' ' in lett True >>> lett = '' >>> len(lett) 0
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.