class PeopleInfo: """ 答题人个人信息 """ age_dict = { '00-04年生': '95后', '05-09年生': '05后', '50-59年生': '50后', '60-69年生': '60后', '70-74年生': '70后', '75-79年生': '75后', '80-84年生': '80后', '85-89年生': '85后', '90-94年生': '85后', '95-99年生': '95后' } def __init__(self, uuid, city, age, sex, crowd): self.uuid = uuid if city is None: self.city = '无城市' else: if city == '上海市' or city == '一线': self.city = '上海市' elif city in ['无锡市', '杭州市', '苏州市', '宁波市']: self.city = '上海周边' else: self.city = '其他' age_1 = self.age_dict.get(age) if age_1: self.age = age_1 else: self.age = '无年龄' self.sex = sex self.crowd = crowd if __name__ == '__main__': print(len(''))