input: Write a python function to compare two strings and calculate the percentage of characters in the first string that are present in the second string.
  assert compare_strings("hello", "world") == 40.0
  assert compare_strings("python", "typhoon") == 66.66666666666667
  assert compare_strings("abc", "def") == 0.0
output: def compare_strings(str1, str2):
      common_chars = set(str1) & set(str2)
      percentage = (sum(str1.count(char) for char in common_chars) / len(str1)) * 100
      return percentage