خرید بک لینک

Vote count: 0

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.

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()

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 3 ارديبهشت 1395 ساعت: 10:14

صفحه بندی