Skip to content

Commit 5de905b

Browse files
committed
lab11 in progress
1 parent ffac32f commit 5de905b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

code/daniel/lab11-contact_list/contact_list.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
headers[2]: the_favorite_color
4444

4545
}
46-
print(contact_dict)
46+
# print(contact_dict)
4747

4848
contacts_list.append(contact_dict)
4949
pprint.pprint(contacts_list)
@@ -58,22 +58,24 @@
5858
# Version2
5959
#==========================================================
6060

61-
# def record():
62-
# get_info = []
63-
# get_name = input("Add a name to the contact list: ")
64-
# get_fruit = input(f"What is {get_name}'s favorite fruit?: ")
65-
# get_color = input(f"What is {get_name}'s favorite color?: ")
66-
# get_info.append(get_name)
67-
# get_info.append(get_fruit)
68-
# get_info.append(get_color)
69-
# # print(get_info)
61+
def record():
62+
# get_info = []
63+
get_name = input("Add a name to the contact list: ")
64+
get_fruit = input(f"What is {get_name}'s favorite fruit?: ")
65+
get_color = input(f"What is {get_name}'s favorite color?: ")
66+
contact_list.append(get_name)
67+
contact_list.append(get_fruit)
68+
contact_list.append(get_color)
69+
# print(get_info)
7070

71-
# record()
71+
record()
7272

73-
# with open('contact_list.csv', 'r') as file:
74-
# lines = file.write(get_info)
73+
with open('contact_list.csv', 'r') as file:
74+
lines = file.write(get_info)
7575

7676

7777
#==========================================================
7878
# Version3
79-
#==========================================================
79+
#==========================================================
80+
81+

0 commit comments

Comments
 (0)