# Download StarWars.csv file from # https://storage.googleapis.com/cs1111/examples/file/StarWars.csv # Save it to your machine (same folder where your .py file is) # Write a function to open and read a file named StarWars.csv # from https://storage.googleapis.com/cs1111/examples/file/StarWars.csv # The function will return a dictionary containing # the number of fans and the total number of respondents. # That is, { 'number_fans': 552, 'total_respondents':1186 } # There are many columns (or fields) for each line. # You only need the following columns to complete this exercise: # RespondentID (column 0) # Have you seen any of the 6 films in the Star Wars franchise? (column 1) # -- possible value "Yes" or "No" # Do you consider yourself to be a fan of the Star Wars film franchise? (column 2) # -- possible value "Yes" or "No" # Note: There are exactly 2 header lines. ## this solution reads a file locally def count_number_fans(filename): print(count_number_fans("StarWars.csv"))