Python has duck-typing and for me this is 'assignment type'.
I also observe that the description is ambiguous or missing some vital points.
That aside I would recommend break task at hand into smaller subtasks. Something like:
- how to open the file and iterate it row-by-row
- how to determine whether row (string) contains specific substring
- how to copy from position X to position Y
- how to add to the string at specific position, even if it's out of bounds
- how to write to file
All these subtasks are simple enough to solve and combining them all together should give solution.
Quote:When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.
--James Whitcomb Riley
I also observe that the description is ambiguous or missing some vital points.
That aside I would recommend break task at hand into smaller subtasks. Something like:
- how to open the file and iterate it row-by-row
- how to determine whether row (string) contains specific substring
- how to copy from position X to position Y
- how to add to the string at specific position, even if it's out of bounds
- how to write to file
All these subtasks are simple enough to solve and combining them all together should give solution.
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.