A simple list-comprehension
>>> l = [10, 8, 4, 4, 13, 1, 1, 1, 1, 6, 1, 2, 1, 1, 0, 1, 5, 1, 5, 5, 2, 1, 0, 0, 4]
>>> [1 if i else 0 for i in l]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1]
The reason your code was not working is because you are iterating (looping) through each item of the list, but not modifying the item in the original list, only the returned item.
Timers (In order of speed):
# my method: [1 if i else 0 for i in l]
>>> timeit.Timer('[1 if i else 0 for i in l]', setup='from __main__ import l').repeat()
[1.4960370266417915, 1.457976119063474, 1.457053021255831]
# Roman Pekar: [1 if x > 0 else 0 for x in l]
>>> timeit.Timer('[1 if x > 0 else 0 for x in l]', setup='from __main__ import l').repeat()
[1.5296303022631434, 1.5041486202146075, 1.51295106957906]
# inspectorG4dget: [int(i>0) for i in myList]
>>> timeit.Timer('[int(i>0) for i in l]', setup='from __main__ import l').repeat()
[5.0810576000558285, 4.865218180917736, 4.7859557786252935]
# Haidro: map(int, map(bool, l))
>>> timeit.Timer('map(int, map(bool, l))', setup='from __main__ import l').repeat()
[5.725813168085608, 5.759308116913473, 5.549817013103507]
# alecxe: map(lambda x: int(x > 0), l)
>>> timeit.Timer('map(lambda x: int(x > 0), l)', setup='from __main__ import l').repeat()
[7.054628605392196, 7.291914272244128, 7.223923128993391]
# inspectorG4dget: [int(bool(i)) for i in l]
>>> timeit.Timer('[int(bool(i)) for i in l]', setup='from __main__ import l').repeat()
[8.60473766374804, 8.537255398342722, 8.545150893104449]