https://blog.csdn.net/u010788049/article/details/82085734
我写了好多行结果是别人一句话的事,受教了受教了(抱拳)
return (set(s) == set(t) and all(s.count(i) == t.count(i) for i in set(s)))
all() 函数用于判断给定的可迭代参数 iterable 中的所有元素是否都为True,如果是返回 True,否则返回 False (返回的是一个bool值)。与之对应的的还有any(): 只要可迭代参数iterable有一个是True那么就返回True。
元素除了是 0、空、FALSE 外都算True。
原文:https://blog.csdn.net/u010788049/article/details/82085734?utm_source=copy