input: Write a function to create a simple chatbot using Python and state diagrams. The chatbot should be able to transition between different states based on user input and print appropriate messages. If the chatbot reaches a terminal state with no further transitions, it should end the conversation.
  
  assert chatbot() == [
      "Hello! How can I help you?", 
      "I need some advice", 
      "Sure, what kind of advice do you need?", 
      "Career advice", 
      "It is always a good idea to research the field you are interested in and creating a plan to learn the skills that are required. Make sure to contact professionals in the field to understand their experience.", 
      "Goodbye!"
  ]
  
  assert chatbot() == [
      "Hello! How can I help you?", 
      "Can you answer my questions?", 
      "Yes, I'll do my best! What do you want to know?", 
      "Why is coding so hard", 
      "Coding can be challenging, especially at first. Just remember that with practice, patience and problem solving skills you can overcome the obstacles.", 
      "Goodbye!"
  ]
  
  assert chatbot() == [
      "Hello! How can I help you?", 
      "I need some advice", 
      "Sure, what kind of advice do you need?", 
      "Health advice", 
      "Focus on eating healthy and staying active. Make sure to consult a medical professional if you have any concerns.", 
      "Goodbye!"
  ]
  
  assert chatbot() == [
      "Hello! How can I help you?", 
      "I don't understand what you mean. Please try again.", 
      "Goodbye!"
  ]
output: def chatbot():
      responses = []
      state = "start"
      
      while True:
          if state == "start":
              responses.append("Hello! How can I help you?")
              user_input = input()
              if user_input.lower() == "i need some advice":
                  state = "advice"
              elif user_input.lower() == "can you answer my questions?":
                  state = "questions"
              else:
                  responses.append("I don't understand what you mean. Please try again.")
                  state = "end"
          
          elif state == "advice":
              responses.append("Sure, what kind of advice do you need?")
              user_input = input()
              if user_input.lower() == "career advice":
                  responses.append("It is always a good idea to research the field you are interested in and creating a plan to learn the skills that are required. Make sure to contact professionals in the field to understand their experience.")
                  state = "end"
              elif user_input.lower() == "health advice":
                  responses.append("Focus on eating healthy and staying active. Make sure to consult a medical professional if you have any concerns.")
                  state = "end"
              else:
                  responses.append("I don't understand what you mean. Please try again.")
                  state = "end"
          
          elif state == "questions":
              responses.append("Yes, I'll do my best! What do you want to know?")
              user_input = input()
              if user_input.lower() == "why is coding so hard":
                  responses.append("Coding can be challenging, especially at first. Just remember that with practice, patience and problem solving skills you can overcome the obstacles.")
                  state = "end"
              else:
                  responses.append("I don't understand what you mean. Please try again.")
                  state = "end"
          
          elif state == "end":
              responses.append("Goodbye!")
              break
      
      return responses