On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish <[email protected]> wrote:
> Andre Engels wrote:
>>
>> On 3/12/10, yd <[email protected]> wrote:
>>> else:
>>> raise Exception('{0}, is not a valid choice'.format(choice))
>>>
>>
>> This will cause the program to stop-with-error if something wrong is
>> entered. I think that's quite rude. I would change this to:
>> else:
>> print('{0}, is not a valid choice'.format(choice))
>>
>
> Here's what I get from that, could you please explain why?
You're probably using Python 2.4 or 2.5; the .format method has been
introduced in Python 2.6, and is considered the 'standard' way of
working in Python 3. For older Python versions, this should read
print('%s, is not a valid choice'%(choice))
--
André Engels, [email protected]
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor