I have a string separated by newline characters, I need to work with each line individually. I though I would be able to iterate over by using 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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With