I have a text file called
one.txt, which contains the following string, each in a different line:
hat cow Zu6 This is a sentence
Now, I want to store each string from each line in a different variable. For example:
a = 'hat' b = 'cow' c = 'Zu6' d = 'This is a sentence'
Now, I know how to read input from files in Python. Here's what I have done so far:
f = open(r'<file_path>', 'r') a = f.read() print a
However, here's what
a contains right now:
'hat\ncow\nZu6\nThis is a sentence'
How can I store each string written on each line in a different variable?