Skip to content

Commit 96f7ac4

Browse files
Finished version 1 of lab 11.
1 parent 8c33f55 commit 96f7ac4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

code/zach/lab11-contact-list.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
def version1():
2-
with open('contacts.csv','r') as file:
2+
with open('contacts.csv', 'r') as file:
33
lines = file.read().split('\n')
4-
print(lines)
4+
#print(lines)
5+
6+
index = 1
7+
headers = lines[0].split(",")
8+
9+
while index < len(lines):
10+
contact = lines[index].split(",")
11+
print(dict(zip(headers, contact)))
12+
index += 1
513

614
def version2():
715

0 commit comments

Comments
 (0)