if genre == 'Social Networking' or 'Games':
The above results in a different output than the below:
if genre == 'Social Networking' or genre == 'Games':
Does anyone know why this would be the case? Full code below if needed, it is just from a python beginner course I am doing on dataquest.
opened_file = open('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
games_social_ratings = []
for row in apps_data[1:]:
rating = float(row[7])
genre = row[11]
# Complete code from here
if genre == 'Social Networking' or == 'Games':
games_social_ratings.append(rating)
avg_games_social = sum(games_social_ratings)/len(games_social_ratings)
print (avg_games_social)