[Tutor] Help with code
Alan Gauld
alan.gauld at yahoo.co.uk
Thu Mar 28 19:05:51 EDT 2019
On 28/03/2019 21:12, lucasbreault2400 at gmail.com wrote:
> I’m trying to make a password that must contain a number in it.
I assume you mean you want to check whether a password
has a number in it? Does it need to be a single digit
or can there be multiple?
> Which method do I use for that?
There is a string method called isdigit() that will
test for a number. You can loop over each character
in the password and apply that method.
This smells a bit like homework so I won't go any further
than that, but if you get stuck send us your code and
we'll try to help some more.
--
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