In Java, I can use for like this:
for (index=candate*2;index<=topCandidate;index+=candidate)
I want to know how I can do this in Python?
The short answer is that you wouldn't. For loops in Python iterate over an iterable, much like Java's for (:) syntax. You can generate a numeric iterable with range() or xrange(), but consider using an existing iterable instead, possibly in conjunction with the functions in itertools.