I am new to programming so please excuse my shallow knowledge with coding. I have a .csv file that I can open with excel. Each row represents a person's name and their details (like address, phone number and age) with each detail in different columns. Whenever I move onto a new row it is another person's detail.
I want to import this information into python such that each row (i.e. every detail of that person) is in 1 tuple (with each detail separated with a ',') and I want all the tuples in a list. So basically a list with tuples inside them.
I have started with the coding from opening the file but just don't know how to implement each detail detail of the person in a tuple and all the tuples in a list. I am using Python 2.7.
def load_friends(f):
"""
Takes the name of a file containing friends information as described in the
introduction and returns a list containing information about the friends
in the file.
load_friends(var) -> list
"""
openfile = open('friends.csv', 'Ur')
if f == 'friends.csv':
openfile = open('friends.csv', 'Ur')
lines = openfile.readlines()
print lines
openfile.close()