File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
code/daniel/lab11-contact_list Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 43
43
headers [2 ]: the_favorite_color
44
44
45
45
}
46
- print (contact_dict )
46
+ # print(contact_dict)
47
47
48
48
contacts_list .append (contact_dict )
49
49
pprint .pprint (contacts_list )
58
58
# Version2
59
59
#==========================================================
60
60
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)
70
70
71
- # record()
71
+ record ()
72
72
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 )
75
75
76
76
77
77
#==========================================================
78
78
# Version3
79
- #==========================================================
79
+ #==========================================================
80
+
81
+
You can’t perform that action at this time.
0 commit comments