I have a line separated by newline characters, I need to work with each line individually. Although I could iterate through a for loop. However, this prints each character individually.
Example:
convo = "Bob: Hello \n Sandy: How are you? \n Bob: Confused by a python problem"
for line in convo:
print(line)
>>> B
>>> o
>>> b
>>> :
What would be the best way to do this?
source
share