LIMITED TIME OFFER: 50% OFF OF PREMIUM WITH OUR ANNUAL PLAN (THAT'S $294 IN SAVINGS).
GET OFFER

Stripped_test_data isn’t defined in your code, but we expected it to be list type

Screen Link: https://app.dataquest.io/m/351/cleaning-and-preparing-data-in-python/7/parsing-numbers-from-complex-strings-part-one

def strip_characters(string):
    for char in bad_chars:
        string = string.replace(char,"")
    return string

stripped_test_data = []
for d in test_data:
    date = strip_characters(d)
    stripped_test_data.append(date)

What I expected to happen:

What actually happened:

stripped_test_data isn’t defined in your code, but we expected it to be list type

I have already refreshed, closed the page, started all over again and I get the same error. I am now even using the given answer and get the same error.
If anybody could help me, I’d appreciate it.

Hi @mariac.andrea,

Welcome to the Community!

I opened your screenshot, pressed the Restore Initial Code button (to the right of the Submit Answer button), added your piece of code to the end of the restored screen, pressed Submit Answer, and it worked perfectly. Can you please try this approach, with Restore Initial Code?

Hi Elena, thanks for the reply!

I actually did that (restore initial code) also with no success.
At some point, I ignored it and continued the other exercises. Then I came back and it worked!

Regards,

1 Like

I have the similar issue
Even using the given answer and getting the same error

Hey guys, I have the same issue! I pressed Restore Initial Code button! After that I delete all code at the code screen, after that copy and paste all the answers then press Submit Answer ! It worked even my code has no problem! I think the problem is the check of the platform

Same issue here! I’m going to move on and hope it sorts itself out.