Advertisement
zzz6366

Untitled

Oct 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. L=[]
  2.  
  3. #The createDatabase function opens the input file, reads it and returns a list of lists, L.
  4. def createDatabase():
  5.  
  6. file=open("CD_Store.txt", 'r')
  7.  
  8. for i in file:
  9. line=i.strip("\n")
  10. line=line.split(",")
  11. L.append(line)
  12.  
  13. #Opens the file, gets each record as a list consisting of of elements, and appends each line to the empty list,
  14. file.close()
  15. return L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement