I think what you want there is the modulo operator, which gives the remainder of a division. It's % (that's percent sign, in case of encoding difficulties) in most languages, including Python (pretty sure).
So 4 % 2, for example, will return a result of 0, because 4 / 2 has a remainder of 0.
Thus you'll want something that looks like (in terrible psuedocode, because it's ages since I did any Python):
for int in range(7,12): if int % stitch-total == 0: [ whatever you want to do with it here ]
I can't remember exactly how Python does for-loops, so like I said, horrible psuedocode...
Let me know if that wasn't clear enough? I have a bit of brain fog going on, sorry.
no subject
Date: 2016-01-22 11:00 pm (UTC)So 4 % 2, for example, will return a result of 0, because 4 / 2 has a remainder of 0.
Thus you'll want something that looks like (in terrible psuedocode, because it's ages since I did any Python):
for int in range(7,12):
if int % stitch-total == 0:
[ whatever you want to do with it here ]
I can't remember exactly how Python does for-loops, so like I said, horrible psuedocode...
Let me know if that wasn't clear enough? I have a bit of brain fog going on, sorry.