old_contents: from plugin import plugin
  import random
  
  @plugin("random number")
  def random_password(jarvis, s):
      stringFail = True
  
      while (stringFail):
          try:
              smallest_number = int(input("Enter the smallest number possible: "))
              higher_number = int(input("Enter the higher number possible: "))
              stringFail = False
          except:
              print('Only integers will be accepted')
  
      """If the user change the order of input"""
      if(higher_number < smallest_number):
          aux = higher_number
          higher_number = smallest_number
          smallest_number = aux
  
      preText = "Your random number is";
      random_number = random.randint(smallest_number,higher_number+1)
      print(preText, random_number)
new_contents: from plugin import plugin
  import random
  
  @plugin("random number")
  def generate_random_number(jarvis, s):
  
      if s != "":
          input_numbers = s.split(' ', 1)
  
          try:
              smallest_number = int(input_numbers[0])
              higher_number = int(input_numbers[1])
          except:
              print('Values are invalid please:')
              smallest_number, higher_number = get_user_input()
      else:
          smallest_number, higher_number = get_user_input()
  
      """If the user change the order of input"""
      if higher_number < smallest_number:
          aux = higher_number
          higher_number = smallest_number
          smallest_number = aux
  
      pre_text = 'Your random number in range [%d, %d] is' % (smallest_number, higher_number);
      rand_number = random.randint(smallest_number, higher_number)
      print(pre_text, rand_number)
  
  
  def get_user_input():
      string_fail = True
      while string_fail:
          try:
              smallest_number = int(input('Enter the smallest number possible: '))
              string_fail = False
          except:
              print('Only integers will be accepted')
  
      string_fail = True
  
      while string_fail:
          try:
              higher_number = int(input('Enter the higher number possible: '))
              string_fail = False
          except:
              print('Only integers will be accepted')
  
      return smallest_number,higher_number;
subject: make the functions more modular