deleting letters from strings without string methods or imports?
<p>This is a homework question. I need to define a function that takes a word and letter and deletes all occurrences of that letter in the word. I can't use stuff like regex or the string library. I've tried...</p>

<pre><code>def delete(word,letter):
    word = []
    char = ""
    if char != letter: 
        word+=char
    return word
</code></pre>

<p>and</p>

<pre><code>def delete(word,letter):
    word = []
    char = ""
    if char != letter:  #I also tried "if char not letter" for both
        word = word.append(char)
    return word
</code></pre>

<p>Both don't give any output. What am I doing wrong?</p>
