Can i please know how the data from a file can be split into two separate lists. For example, file contains data as 1,2,3,4;5,6,7
my code:
for num in open('filename','r'):
list1 = num.strip(';').split()
Here , i want a new list before semi colon (i.e) [1,2,3,4] and new list after semi colon (i.e) [5,6,7]
list1 = num.split(';')[0].split(',')list2 = num.split(';')[1].split(',')