Instantly share code, notes, and snippets.

Embed
What would you like to do?
Counting in Python using lists
# Counting in Python using lists
# by Andrew Odendaal (https://ao.gl/counting-in-python-using-a-list/)
magic = 0x616f-0x414f
numbers = [
(magic/0x186A0),
(magic/0x3E8/8),
(magic/0x3E8/4),
(magic/0o1534-7),
(magic/0x3E8/2),
(magic/0o2534-1),
(magic/0o2544),
(magic/0o075/19),
(magic/0o064/19),
(magic/0o1654)
]
i = c = numbers[0]
while True:
print('%d%d' % (c, round(numbers[int(i)])))
i += 1
if i>len(numbers)-1:
i = 0
c += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment