Mar-13-2018, 07:37 PM
I have begun working on a new function, I will keep things simple by not detailing the full scope of the function, which would be uneeded information for this question.
I created a function which was to simply place a list object inside of another list object. The problem I am having is that even though the list object appears in the parent list, when I try to call it by name, python tells me the list is not defined.
How do I map the name of the list that I pass through my function, so that the list that's created has that name?
I created a function which was to simply place a list object inside of another list object. The problem I am having is that even though the list object appears in the parent list, when I try to call it by name, python tells me the list is not defined.
def date(D):
"""This function takes a list(date), and indexes it in another
list('List_Of_Dates')."""
List_Of_Dates.append(D)
D=[]
>>>date("March_13_2018")
>>>List_Of_Dates
[[]]
>>>March_13_2018
[error][/error]***NAME ERROR***: March_13_2018 is not defined.From the output of the python interpreter, I can tell that my function is actually creating a list and appending it to List_Of_Dates. The problem seems to be that my name assignment "March_13_2018" is not being attached to the list object, what I get is a "nameless, or undefined" list.How do I map the name of the list that I pass through my function, so that the list that's created has that name?
