任务一:有效的括号 题目链接:https://leetcode-cn.com/problems/valid-parentheses/ 自己的答案: class Solution: def isValid(self, s): s = list(s) length = len(s) #空字符串被认为是有效字符串 if length == 0: return True stringList = ['(', ')', '[', ']', '{', '}'] for s_element in s: if…