input: Write a function to compute the average salary from a 'salary.csv' file. The function should read the CSV file, sum all the salary values, and return the average salary. The 'salary.csv' file contains at least a header with 'name' and 'salary' fields, followed by multiple rows with corresponding values. If the file is empty or contains no salary data, the function should return 0.
  
  import csv
  
  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
    else:
      return total/count
  
  assert get_average_salary('salary.csv') == 2000.0
  assert get_average_salary('empty_salary.csv') == 0
  assert get_average_salary('one_entry_salary.csv') == 5000.0
output: import csv
  
  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
    else:
      return total/count