Oct-15-2016, 04:36 PM
(Oct-15-2016, 12:58 PM)Yoriz Wrote: On each iteration of your loop the dictionary over writes the same two keys. Would it be preferable to use a list instead or on each loop the key names will need changing to something unique to the dictionary each time.
If you want the two keys values to be a list, first asign each of them as a list outside of the loop then inside the loop append to the list of each key.
I've tried but it gives me an error or again only the last line. I'm supposed to create a function that reads the file then create and return a dictionary.
This is my output:
{'Name': ['ZIPA_ECOLI'], 'Value': ['MMQDLRLILIIVGAIAIIALLVHGFWTSRKERSSMFRDRPLKRMKSKRDDDSYDEDVEDDEGVGEVRVHR', 'VNHAPANAQEHEAARPSPQHQYQPPYASAQPRQPVQQPPEAQVPPQ..... ']}