[Tutor] value range checker

Alan Gauld alan.gauld at btinternet.com
Fri Aug 28 12:28:15 CEST 2015


On 26/08/15 17:29, Alan Gauld wrote:

> def make_validator(min, max, *values):
>      def validate(value):
>          return (min <= value <= max) or value in *values)
>      return validator

Oops!
Should of course be

        return validate

Sorry,

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list