input: Write a function to compute the average salary from a CSV file containing salary data. The function should return the average salary as a float. If the file is empty or contains no salary data, the function should return 0.0.
  import csv
  
  def get_average_salary(filename):
    total = 0
    count = 0
  
    try:
      with open(filename, 'r') as csvfile:
        csvreader = csv.reader(csvfile)
        next(csvreader) # skip header
  
        for row in csvreader:
          total += int(row[1])
          count += 1
  
      if count == 0:
        return 0.0
      return total/count
  
    except FileNotFoundError:
      return 0.0
  
  assert get_average_salary('salary.csv') == 2000.0
  assert get_average_salary('empty.csv') == 0.0
  assert get_average_salary('no_data.csv') == 0.0
  assert get_average_salary('nonexistent.csv') == 0.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
  
        for row in csvreader:
          total += int(row[1])
          count += 1
  
      if count == 0:
        return 0.0
      return total/count
  
    except FileNotFoundError:
      return 0.0
  