[Tutor] why is this so?
Rafael Durán Castañeda
rafadurancastaneda at gmail.com
Sun Sep 18 13:13:28 CEST 2011
You are comparing a string value with string class, so they can't be
compared. You can do:
>>> type("love") is str
True
>>>
so you compare types
2011/9/18 Khalid Al-Ghamdi <emailkgnow at gmail.com>
> Hi All,
>
> why is this so?
>
> >>> type('love')
> <class 'str'>
> >>> "love" is str
> False
> >>>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110918/9ae6fce0/attachment.html>
More information about the Tutor
mailing list