Blue Week Special Offer | Brighten your week!

Apps_data error

Screen Link:

My Code:

""" opened_file = open('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)

for app in apps_data[1:]:
    price = float(app[4])
    if price == 0.0:
    else :
        app.append('non free')
print(apps_data[:6]) """

What I expected to happen:

What actually happened:

apps_data      error

Hi @KhaledHanafy: you did not initialise free_or_not as an empty list thus it is throwing an error. The list should be initialised before the loop

I tried to run your code.
It’s a classic case of typo (and it happens all the time with programmers) :stuck_out_tongue:

DQ system is expecting a ‘-’ between non and free


instead of

app.append(‘non free’)

thank you for your help, i thought it would be ok since its a string but i guess not.

I haven’t understand that why we must write down as “non-free”?

Hi @cem.ayhan,
It is basically for Data Quest answer checking system. The answer checking system looks for an exact match for things given in the instruction. Though “Non Free”, “Non free”, “Non_Free” and “Non-free” all looks the same, but for a machine, they all are different. I hope this clarifies.