title: How to change separator in a list from "," to ";" not using the join function or any list operations
body: <p>I have to set a method that returns a string from the content of a given object. I am able to make the string of the list of numbers but my professor wants the separator between each element to be a semicolon instead of a comma, which I am having trouble doing. I tried using the join function but I then realized that my professor does not want to use any list operations like <code>len</code> or <code>in</code> besides append and reading and writing to an index .</p>
  
  <p>I have already tried to concatenate the semicolon to the string but of course, that only concatenates the semicolon at the end of the string and doesn't separates each element with a semicolon.</p>
  
  <p>Here is my code </p>
  
  <pre><code>class LinkedList:
    def __init__(self, lst=[], size = 0):
      self.L = lst
      self.size = size
    def addLast(self, x):
      self.L.append(x)
      self.size += 1
    def removeFirst(self):
      L = self.L
      p = L[1:]
      return p
    def __str__(self):
      result = ''
      result += str(self.L)
      return result
  </code></pre>
  
  <p>Using this as a test case, you can see that it prints out as [1, 2, 3] instead of "[1;2;3]"</p>
  
  <pre><code>lst = LinkedList()
  print(lst) # prints []
  print(lst.size) # prints 0
  lst.addLast(1)
  lst.addLast(2)
  print(lst.size) # prints 2
  lst.addLast(3)
  print(lst) # this should print "[1;2;3]"
  </code></pre>