How do I make the code so it reads the file and splits it so that it can assign which lines I specify into a certain named list. I want the first 3 lines to be assigned into a list then the next 3 and so on, so it would be:
list1 = Steve, Cat, v, 2, 3, 4, 1, 28
list2 = John, Dog, h , 6, 1, 7, 2, 45
list3 = (something)
text file below named character:
Steve
Cat
v 2 3 4 1 28
John
Dog
h 6 1 7 2 45
main code below
character_file = open("character.txt", 'r')
character_list = character_file.readlines()
for character in character_list:
print(character)
character_list_split = character.split()
Steve = character_list_split[0,2]
John = character_list_split[3,5]
character_file.close()
print(Steve)
print(John)
Thanks for the help I'm new to python