Date: 2016-01-22 11:00 pm (UTC)
randomling: A wombat. (Default)
From: [personal profile] randomling
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.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at [email protected]

Profile

untonuggan: Lily and Chance squished in a cat pile-up on top of a cat tree (buff tabby, black cat with red collar) (Default)
lizcommotion

October 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2025 09:32 am
Powered by Dreamwidth Studios
OSZAR »