input: Write a function to compute the average salary of people from a given CSV file 'salary.csv'. The function should skip the header row, loop through the remaining rows, sum up the salaries, and then compute the average. If the file is empty or there are no valid salary entries, return 0.
  assert get_average_salary('salary.csv')==2000.0
  assert get_average_salary('empty_salary.csv')==0
  
  def get_average_salary(filename):
    total = 0
    count = 0
  
    with open(filename, 'r') as csvfile:
      csvreader = csv.reader(csvfile)
      next(csvreader) # skip header
  
      # loop through the CSV rows
      for row in csvreader:
        total += int(row[1])
        count += 1
    
    if count == 0:
      return 0
    return total/count
output: def get_average_salary(filename):
    total = 0
    count = 0
  
    with open(filename, 'r') as csvfile:
      csvreader = csv.reader(csvfile)
      next(csvreader) # skip header
  
      # loop through the CSV rows
      for row in csvreader:
        if len(row) > 1:
          total += int(row[1])
          count += 1
    
    if count == 0:
      return 0
    return total/count