input: Write a function to create a simple chatbot using Python and state diagrams. The function should initialize the state machine and handle the user input according to the predefined states and their transitions. The function should return the conversation recorded as a list of messages.
  assert create_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.']
  assert create_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.']
  assert create_chatbot([]) == ['Hello! How can I help you?', 'Can you answer my questions?', 'Yes, I'll do my best! What do you want to know?', 'Where can I find good tutorials', 'You can find tutorials online or join coding communities to get help from experienced coders. StackOverflow and Cod Academy are great resources.']
  assert create_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.']
output: def create_chatbot(user_inputs):
      conversation = []
      states = {
          'start': {
              'message': 'Hello! How can I help you?',
              'transitions': {
                  'I need some advice': 'advice_type',
                  'Can you answer my questions?': 'answer_questions'
              }
          },
          'advice_type': {
              'message': 'Sure, what kind of advice do you need?',
              'transitions': {
                  'Career advice': 'career_advice',
                  'Health advice': 'health_advice'
              }
          },
          'career_advice': {
              'message': '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.',
              'transitions': {}
          },
          'health_advice': {
              'message': 'Focus on eating healthy and staying active. Make sure to consult a medical professional if you have any concerns.',
              'transitions': {}
          },
          'answer_questions': {
              'message': 'Yes, I\'ll do my best! What do you want to know?',
              'transitions': {
                  'Where can I find good tutorials': 'tutorials',
                  'Why is coding so hard': 'coding_hard'
              }
          },
          'tutorials': {
              'message': 'You can find tutorials online or join coding communities to get help from experienced coders. StackOverflow and Cod Academy are great resources.',
              'transitions': {}
          },
          'coding_hard': {
              'message': 'Coding can be challenging, especially at first. Just remember that with practice, patience and problem solving skills you can overcome the obstacles.',
              'transitions': {}
          }
      }
      
      current_state = 'start'
      
      for user_input in user_inputs:
          conversation.append(states[current_state]['message'])
          current_state = states[current_state]['transitions'].get(user_input, current_state)
      
      if current_state != 'start':
          conversation.append(states[current_state]['message'])
      
      return conversation