I read elements from a txt file and I want to write elements to the array, I know I must use substring method but I don't know how to generate an array while I am using substring method.
example.txt file includes
001, A, 50, 70, 65
002, B, 25, 55, 80
003, C, 60, 40, 85
004, D, 75, 55, 70
005, E, 40, 40, 45
006, F, 35, 25, 85
My python code:
file = open("example.txt", "r")
a = file.read()
print(a)
I need to generate 30 elements multi dimensional(5x6) array, I can read elements of this file using this code but I wonder that how to write them to the array.
str.splitandstr.strip