I am out of trial and error again Lists
alex23
wuwei23 at gmail.com
Wed Oct 22 21:37:27 EDT 2014
More information about the Python-list mailing list
Wed Oct 22 21:37:27 EDT 2014
- Previous message (by thread): I am out of trial and error again Lists
- Next message (by thread): I am out of trial and error again Lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 23/10/2014 10:02 AM, Seymore4Head wrote: > On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence > <breamoreboy at yahoo.co.uk> wrote: >>>>> One more question. >>>>> if y in str(range(10) >>>>> Why doesn't that work. >> I suggest you try str(range(10)) from the interactive prompt and see >> exactly what you get, as it's nothing like what you expect :) > > I see that now. So there may not be a short hand solution. There are two 'short hand solutions' to do what you want here: import string if y in string.digits: .... Or even simpler: if y.isdigit(): ...
- Previous message (by thread): I am out of trial and error again Lists
- Next message (by thread): I am out of trial and error again Lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list