[Tutor] How to determine if every character in one string is inanother string?

Alan Gauld alan.gauld at btinternet.com
Sun Jul 22 00:29:17 CEST 2007


"Jerry Hill" <malaclypse2 at gmail.com> wrote 

> I like this one:
> all(char in string.printable for char in testString)

What is all?
Is that a 2.5 thing (I'm still on 2.4 here)

>>>> testString = "qwerty\buiop"
>>>> all(char in string.printable for char in testString)
> False
> 
> -- 
> Jerry
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>



More information about the Tutor mailing list