Welcome to the Treehouse Community
Looking to learn something new?
toanh tran9,083 Points
Data Science Basic. I can't figure out what is wrong with my code. Please review. I get the Bummer! Try again.
Challenge Task 2 of 2
Now that you have the csv module imported, write a function named open_with_csv that takes one argument, a string with a file name. Within open_with_csv, assign an empty list to a variable named data. Return the value of data.
import csv def open_with_csv(filename, d='\t'): data =  with open(filename, encoding='utf-8') as tsvin: tsvin = csv.reader(tsvin, delimiter=d) for row in tsvin: data.append(row) return data
Ken AlgerTreehouse Teacher
This challenge is rather explicit in what it wants. You have some extra code in there that it is not expecting to see which alters the data.
Post back if you are still stuck.
import csv def open_with_csv(filename, d='\t'): data =  return data