Replacing an even element with another element
<p>I am having trouble with this part with my class assignment. It ask to replace an even element with a 0. I have tried but kept getting error for trying to divide it in anyway. Is there a way to replace even numbers with 0, I might end up adding a user input later on, so have to code where it finds an even number and replace it.</p>

<pre><code>def main():  

    list = [7, 2, 2, 4, 5, 6, 9]

    print(sectionC(list))

def sectionC(list):  
    for n, i in list:
        if list == i//2:
            list[n]=0
main()
</code></pre>