擅长:python、mysql、java
<p>尝试在字典项上循环,然后在值列表上循环:</p>
<pre><code>for key, vals_list in a.items():
if len(set(vals_list)) <= 1:
print(f'{key}: All values are same!')
# Will do nothing if `vals_list` is empty
for value in vals_list:
your_other_func(value)
</code></pre>