a = (3.6, "python", [7, 2.3, 7, 8.9], {'F': '108', 'G': 88}, "python", 3.6, "python", '20')b = {}for i in a: if a.count(i) > 1: b[i] = a.count(i)print(b)
打印出一个数组里所有重复元素的元素,次数:
{3.6: 2, 'python': 3}