How To Check If Element Has A String In Python