input: Write a python function to generate a table of contents given a list of headings.
  assert generate_toc(["Introduction", "Fundamentals", "Algorithms", "Design Patterns", "Conclusion"]) == "1.Introduction\n2.Fundamentals\n3.Algorithms\n4.Design Patterns\n5.Conclusion"
  assert generate_toc(["Chapter 1", "Chapter 2", "Chapter 3"]) == "1.Chapter 1\n2.Chapter 2\n3.Chapter 3"
  assert generate_toc(["Part A", "Part B"]) == "1.Part A\n2.Part B"
output: def generate_toc(headings):
      return "\n".join(f"{i+1}.{heading}" for i, heading in enumerate(headings))