Len of IOS apps displaying 0

Screen Link:
https://app.dataquest.io/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/8/isolating-the-free-apps

My Code:

Creating a loop for Android that will append free apps to our final list

Android_final =
for app in android_english:
price = app[7]
if price == ‘0’:
Android_final.append(app)

#Creating a loop for IOS that will append free apps to our final list
Ios_final =
for app in Ios_english:
price = app[4]
if price == ‘0’:
Ios_final.append(app)

print(len(Android_final))
print(len(Ios_final))

Replace this line with your code

What I expected to happen:
print(len(Android_final))
print(len(Ios_final))

What actually happened:
8864
0

Replace this line with the output/error

I am wondering why length of IOS apps showing 0. Though i cross checked the code with solution it is same. Please advise if i am missing something here.
Thank you

If you look at the data, the cost is not ‘0’ but is ‘0.0’ for free apps (at least some). Since you’re comparing numbers, it’s probably better to convert the cost to a float and and check if it is equal to 0.

@ebuschang:

Ohh Yeah! I gotcha now.
Poor me I didn’t noticed the decimal 0.0 numbers in Prices. Cool I figured it out and now i can see the length for IOS apps too.

Thank you for you help.
Cheers

1 Like