Re: [Gramps-devel] python and integers From: Benny Malengier - 2008-05-22 12:48:56 Attachments: Message as HTML ```2008/5/22 James A. Treacy : > On Wed, May 21, 2008 at 05:27:18PM -0700, Rob G. Healey wrote: > > Greetings: > > > > In working with integers in python, /if an integer is greater than > > 9, so 10 and above. How do I break it down to just the ones part to > > test it for adding something to it based on 1st, 2nd, 3rd. I am wanting > > to add the st nd and rd part to it..... > > x = 9 > ones = x%10 > > -- In case above is cryptic rob, James means the modulus operator: For the time being, we will concentrate on the follow arithmetic operators: - The addition operator, + - The subtraction operator, - - The multiplication operator, * - The division operator, / - The modulus operator, % More in: http://www.python.org/doc/current/ref/operators.html Benny ```
 [Gramps-devel] python and integers From: Rob G. Healey - 2008-05-22 00:27:29 Attachments: application/pgp-signature Message as HTML ```Greetings: In working with integers in python, /if an integer is greater than 9, so 10 and above. How do I break it down to just the ones part to test it for adding something to it based on 1st, 2nd, 3rd. I am wanting to add the st nd and rd part to it..... -- Sincerely Yours, Rob G. Healey -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.8 (GNU/Linux) mQGiBEfJ/JIRBACPx6Yte7DaICFpt/PnAfYuy5c9+zttisjPhwBqGuSMx8vLilRD R6Gz7kM1n5MzU9D3d2nrkEK6GsIiltPuP4MTBjUv9z/JVeloETcHZYPoXHiU7PVr SrSv3zdRw/yDl4dlVvSPsWtHBAUBsjyVnzjysug6ZAYCs9gt4XBSMo3WCwCgm+F8 GVR741oSn8gQdpSeY9GkXpcD/2RazZxY2NZzARjQXUCfU3TKf/hNWkMtwJIzxl4a w1nxS6/7S7JX8twZFopsFulz4ogXkBkrmcZqpUJG6U0wh4EUpZ9VCQFLnsy8YmSo 9pMDSkQdnzADW+M5InRsJkY6DwgUM1a1vRS0FwluuTOe4Wapa/tQCoZbfzC3vyAg Wx5zA/43glhc5aDoRgeIVy1P7o1Gl9kf114dSrIM0DAk/hGarTuiG4mo8tFeuIio Olkrzr2ew5Hy4+HPO0utfkTyUNcebNBKOiDf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9pmqmirXnFtnDOsAoJWnCgLx6XpWOov/PM4euMYEgjTZ =7WgK -----END PGP PUBLIC KEY BLOCK----- ```
 Re: [Gramps-devel] python and integers From: James A. Treacy - 2008-05-22 01:08:02 ```On Wed, May 21, 2008 at 05:27:18PM -0700, Rob G. Healey wrote: > Greetings: > > In working with integers in python, /if an integer is greater than > 9, so 10 and above. How do I break it down to just the ones part to > test it for adding something to it based on 1st, 2nd, 3rd. I am wanting > to add the st nd and rd part to it..... x = 9 ones = x%10 -- A: Because it messes up the order in which people normally read text. James Treacy Q: Why is top-posting such a bad thing? treacy@... A: Top-posting. Q: What is the most annoying thing in e-mail? ```
 Re: [Gramps-devel] python and integers From: Benny Malengier - 2008-05-22 12:48:56 Attachments: Message as HTML ```2008/5/22 James A. Treacy : > On Wed, May 21, 2008 at 05:27:18PM -0700, Rob G. Healey wrote: > > Greetings: > > > > In working with integers in python, /if an integer is greater than > > 9, so 10 and above. How do I break it down to just the ones part to > > test it for adding something to it based on 1st, 2nd, 3rd. I am wanting > > to add the st nd and rd part to it..... > > x = 9 > ones = x%10 > > -- In case above is cryptic rob, James means the modulus operator: For the time being, we will concentrate on the follow arithmetic operators: - The addition operator, + - The subtraction operator, - - The multiplication operator, * - The division operator, / - The modulus operator, % More in: http://www.python.org/doc/current/ref/operators.html Benny ```