May-30-2020, 04:44 AM
@BitPythoner, in python you don't need the position, nor need to convert to list - you can iterate over str:
>>> spam = 'name = John' >>> for char in spam: ... print(char) ... n a m e = J o h n >>> for idx, char in enumerate(spam): ... print(f'position:{idx}, char:{char}') ... position:0, char:n position:1, char:a position:2, char:m position:3, char:e position:4, char: position:5, char:= position:6, char: position:7, char:J position:8, char:o position:9, char:h position:10, char:n
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs