擅长:python、mysql、java
<p>这个怎么样</p>
<pre><code>new_dict = {}
for k, v in my_subjects.items():
for x, z in v.items():
if k not in new_dict:
new_dict[k] = [x]
else:
new_dict[k].append(x)
print(new_dict)
</code></pre>
<blockquote>
<pre><code>{'Autumn': [37315, 34567], 'Spring': [23456, 45879]}
</code></pre>
</blockquote>