You may try this:
import os
_, _ ,files = os.walk('.').next()
json = [f[:-5] for f in files if f.endswith('.json')]
png = [f[:-4] for f in files if f.endswith('.png')]
json_only = set(json) - set(png)
png_only = set(png) - set(json)
json_and_png = set(json) & set(png)
... etc...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…