input: Write a function to compute the average salary from a given CSV file containing names and salaries. If the file is empty, return 0. If the file contains only the header, return 0 as well. Ensure to skip the header before processing.
  def get_average_salary(filename):
    total = 0
    count = 0
  
    try:
      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
    except FileNotFoundError:
      return 0
    
    if count == 0:
      return 0
    
    return total/count
  
  assert get_average_salary('salary.csv') == 2000.0
  assert get_average_salary('empty.csv') == 0
  assert get_average_salary('header_only.csv') == 0
output: 
  def get_average_salary(filename):
    total = 0
    count = 0
  
    try:
      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
    except FileNotFoundError:
      return 0
    
    if count == 0:
      return 0
    
    return total/count
  