I was playing around with Python 2.7 and wanted to know if there was a clean way to code a Python equivalent of this Java loop (where you can modify the increment value in the loop):
for (int i = 1; i <= 64; i *= 2) {
# i = 1, 2, 4, 8, 16, 32, 64
}
It seems like in Python you can use range(), but you can only get every nth element (e.g. for i in range(1, 65, 2) will get you every odd element).