if __name__ == '__main__':
# 消费金额(单位:万元)
list1 = [2.3, 4.5, 24, 17, 1, 7.8, 39, 21, 0.5, 1.2, 4, 1, 0.3]
userType = {"platinum": 0, "gold": 0, "silver": 0, "ordinary": 0}
for x in list1:
if x >= 10: userType["platinum"] += 1
elif x >= 5: userType["gold"] += 1
elif x >= 3: userType["silver"] += 1
else: userType["ordinary"] += 1
print(f"客户总数:{len(list1)}")
for t, s in userType.items():
print(f"类型:{t:10}\t人数:{s}")