-actual + expected

Screen Link:

My Code:

# INITIAL 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])
    # Complete code from here
    if price == 0.0:
        app.append('free')
    else:
        app.append('non-free')
apps_data[0].append('free _or_not')
                   
print(apps_data[0])

What I expected to happen:

What actually happened: submit error:-actural + expected

Paste output/error here

[['id',
    'track_name',
    'size_bytes',
    'currency',
    'price',
    'rating_count_tot',
    'rating_count_ver',
    'user_rating',
    'user_rating_ver',
    'ver',
    'cont_rating',
    'prime_genre',
    'sup_devices.num',
    'ipadSc_urls.num',
    'lang.num',
    'vpp_lic',
-   'free _or_not'],
+   'free_or_not'],

As we can see result show -‘free_or_not’], and + ‘free_or_not’] , But I have only append one time. apps_data[0].append(‘free _or_not’). If I print out there is no double entry.

Thanks

hey @HanMoeAung

Welcome to DataQuest Community!

extra spaces after the word “free” might be the mismatch.

'free _or_not' and free_or_not

please update the code apps_data[0].append('free _or_not') and try!

3 Likes