I am learning Python 3 at the moment, and I have a problem with opening a file provided as a function parameter.
This is my code:
def make_list_from_file(file_name):
with open(file_name,"r") as provided_file:
temp_list = [line.strip() for line in provided_file]
detailed_list = [ item.split("\t") for item in temp_list ]
return detailed_list
make_list_from_file(game_stat.txt)
This gives me:
NameError: name 'Game_Stat' is not defined.
The file is in the same directory. I would be grateful for any help.
make_list_from_file("game_stat.txt")csvmodule from the stdlib!