Parsing numbers from complexed strings

I am trying to figure out why my to variables are showing in red.

def process_date(date):
    if "-" in date:
        split_date=date.split("-")
        split_date_one=split_date[0]
        split_date_two=split_date[1]
        average_year= (int(split_date_one) + int(split_date_two))/2
        f_date= round(average_year)  
    else:
        date = int(date)                     
        return date
    
    
processed_test_data=[]

for dates in stripped_test_data:
    date=process_date(dates)
    processed_test_data.append(date)

  
for row in moma:
    date=row[6]
    date=strip_characters(date)
    date=process_date(date)
    row[6]=date

Hey there!

Happy to help, but I think we need a bit more context here — can you clarify what you mean when you say your variables are showing in red? Which ones specifically?

If you could shoot over a screenshot of the errors you’re seeing on your end, that would be incredibly helpful.