On 02/08/15 09:31, Alan Gauld wrote:

them outside the main block and use them in your tests. In that case you
only need one function which I'd call something like test_email()

Ahem. Or you could call it is_good_address() of course! Oops!

def is_good_address(addr):
      if '@' not in addr or '.' not in addr:
          print('email needs @ and . at the same time')
          return False
      else: return True

--
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


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to