(Leetcode) Valid parentheses
Not a performance suggestion, but you can make use of the fact that an empty collection is Falsey.

if len(s) == 0:


Is functionally the same as just:

if not s:


And similarly, 

while len(s) &gt; 0:


Can be just:

while s:


Relevant PEP entry (search for "For sequences" under the linked heading).