Skip to content

Instantly share code, notes, and snippets.

@Elaine-AL
Created May 10, 2019 18:51
Show Gist options
  • Save Elaine-AL/7c95721074ca8c44db5165ab98b5e4d9 to your computer and use it in GitHub Desktop.
Save Elaine-AL/7c95721074ca8c44db5165ab98b5e4d9 to your computer and use it in GitHub Desktop.
My first python program!
open_file = open("AppleStore.csv")
from csv import reader
read_file = reader(open_file)
apps_dataset = list(read_file)
rating_sum = 0
for each_row in apps_dataset[1: ]:
rating = float(each_row[7])
rating_sum += rating
print(rating_sum)
avg_rating = rating_sum/7159
print(avg_rating)
@Elaine-AL
Copy link
Author

This is my first python program that loops through a list of lists from the csv file using for loop to find the average of the app ratings which was 3.52.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment