title: TypeError: unsupported operand type(s) for -: 'str' and 'int' (help)
body: <p>Here is my code:</p>
  
  <pre><code>def get_user_list(message, datatype):
      while True:
          str_input = input(message)
          if str_input == '':
              print('Error: Received no input.')
          for i in range(str_input - 1):
              if datatype == 'int':
                  try:
                      return int(str_input)
                  except ValueError: 
                      print("Error: Element '" + str_input[i] + "' is not of type " + datatype + ".")
              elif datatype == 'float':
                  try:
                      return float(str_input)
                  except ValueError: 
                      print("Error: Element '" + str_input[i] + "' is not of type " + datatype + ".")
  
              else: 
                   return str_input 
  </code></pre>
  
  <p>I cannot figure out what is wrong with it... somone please help... THANKS</p>