input: Write a python function to substitute all spaces in a provided string with underscores, and in cases where there are more than 2 consecutive spaces, replace all consecutive spaces with a dash.
  assert fix_spaces("Example") == "Example"
  assert fix_spaces("Mudasir Hanif ") == "Mudasir_Hanif_"
  assert fix_spaces("Yellow Yellow  Dirty  Fellow") == "Yellow_Yellow__Dirty__Fellow"
  assert fix_spaces("Exa   mple") == "Exa-mple"
  assert fix_spaces("   Exa 1 2 2 mple") == "-Exa_1_2_2_mple"
output: def fix_spaces(sentence):
      sentence = sentence.replace("  ", "_").replace(" ", "_")
      while "__" in sentence:
          sentence = sentence.replace("__", "-")
      return sentence.replace("_-", "-").replace("-_", "-")