vendredi 26 mars 2021

Can someone tell me why my "elif:" is returning a SyntaxError? [closed]

I'm trying create a function that returns a list where all zeroes are at the end of the list, and positive integers at the front of the list. If the list does not have zeroes, I'm trying to simply return the list, unchanged.

def adjust_zero(x)
    
    x = []
    y = []
    
    movers = {0}
    
    for i in x:
        if(i != 0):
            print(x)
        elif:
            for i, j in enumerate(x):
                if j in movers:
                y.append(x.pop(i))
            print(x, y)
        else:
            print(x)

Aucun commentaire:

Enregistrer un commentaire