So entfernen Sie alle Nullen aus einer Liste in Python
X = [0,5,0,0,3,1,15,0,12]
X = [i for i in X if i != 0]
Defiant Dingo
X = [0,5,0,0,3,1,15,0,12]
X = [i for i in X if i != 0]
text = "hello"
print(text.zfill(10))
Output: '00000hello'
a_string = a_string.strip("0")