How to check if a string is empty in python?

John Machin sjmachin at lexicon.net
Wed May 2 17:25:29 EDT 2007


On May 3, 6:35 am, noagbodjivic... at gmail.com wrote:
> How to check if a string is empty in python?
> if(s == "") ??

Please lose the parentheses.
if s == "": will work.
So will if not s:

Have you worked through the tutorial yet?




More information about the Python-list mailing list