On Tue, Jan 28, 2014 at 2:03 AM, <[email protected]> wrote:
> On Monday, 27 January 2014 09:57:32 UTC-5, Chris Angelico wrote:
>> On Tue, Jan 28, 2014 at 1:23 AM, <[email protected]> wrote:
>>
>> > If the farmID < 10:
>> > remove one character from the address column
>> > Elif farmID > 10:
>> > remove two characters from the address column
>>
>> What if farmID == 10?
>>
>> ChrisA
>
> Ok, sorry this is how it should be.
>
> If the FarmID < 10:
> remove one character from the address column
>
> If the FarmID > 9:
> remove two characters from the address column
>
> My issue is I can't figure out what statement to use to define FarmID.
More commonly, that would be written as
if farmID < 10:
# remove one character
else:
# remove two characters
Though this still suffers from the limitation of not handling 100 or
1000, so you might want to look at len(str(farmID)) instead.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list