# 1、文件内容如下,标题为:姓名,性别,年纪,薪资
#
# egon male 18 3000
# alex male 38 30000
# wupeiqi female 28 20000
# yuanhao female 28 10000
#
# 要求:
# 从文件中取出每一条记录放入列表中,
# 列表的每个元素都是{'name':'egon','sex':'male','age':18,'salary':3000}的形式
#
# 2 根据1得到的列表,取出薪资最高的人的信息
# 3 根据1得到的列表,取出最年轻的人的信息
# 4 根据1得到的列表,将每个人的信息中的名字映射成首字母大写的形式
# 5 根据1得到的列表,过滤掉名字以a开头的人的信息
# 6 使用递归打印斐波那契数列(前两个数的和得到第三个数,如:0 1 1 2 3 4 7...)(Unfinished)
#
# 7 一个嵌套很多层的列表,如l=[1,2,[3,[4,5,6,[7,8,[9,10,[11,12,13,[14,15]]]]]]],用递归取出所有的(Unfinished)
#********************************************************************************************************#
# f = open('姓名,性别,年纪,薪资','r+',encoding='UTF-8')
# l = [{'name': line.split()[0], 'sex': line.split()[1], 'age': line.split()[2], 'salary': line.split()[3]}
# for line in f]
# print(l)
#__________________________________________________________________________________________________________#
# for line in f:
# l = [{'name':line.split()[0],'sex':line.split()[1],'age':line.split()[2],'salary':line.split()[3]}]
# print(l)
# [{'name': 'egon', 'sex': 'male', 'age': '18', 'salary': '3000'}]
# [{'name': 'alex', 'sex': 'male', 'age': '38', 'salary': '30000'}]
# [{'name': 'wupeiqi', 'sex': 'female', 'age': '28', 'salary': '20000'}]
# [{'name': 'yuanhao', 'sex': 'female', 'age': '28', 'salary': '10000'}]
#__________________________________________________________________________________________________________#
# l = [[{'name':line.split()[0],'sex':line.split()[1],'age':line.split()[2],'salary':line.split()[3]}]
# for line in f ]
# print(l)
# [[{'name': 'egon', 'sex': 'male', 'age': '18', 'salary': '3000'}], [{'name': 'alex', 'sex': 'male', 'age': '38', 'salary': '30000'}],
# [{'name': 'wupeiqi', 'sex': 'female', 'age': '28', 'salary': '20000'}], [{'name': 'yu
###############################################################################################################
# l = [{'name': line.split()[0], 'sex': line.split()[1], 'age': line.split()[2], 'salary': line.split()[3]}
# for line in f]#需要拼接之后才能进行max处理
# l1 = max(l,key=lambda i:i['salary'])
# print(l1)
# {'name': 'alex', 'sex': 'male', 'age': '38', 'salary': '30000'}
####################################################################################################################
# l = [{'name': line.split()[0], 'sex': line.split()[1], 'age': line.split()[2], 'salary': line.split()[3]}
# for line in f]
# l1 = min(l,key = lambda i:i['age'])
# print(l1)
# {'name': 'egon', 'sex': 'male', 'age': '18', 'salary': '3000'}
#####################################################################################################################
# l = [{'name': line.split()[0], 'sex': line.split()[1], 'age': line.split()[2], 'salary': line.split()[3]}
# for line in f]
# l1 = map(lambda x:x['name'].capitalize(),l)#capitalize首字母大写方法
# print(list(l1))
# ['Egon', 'Alex', 'Wupeiqi', 'Yuanhao']
# m=map(lambda x:x['name'].capitalize(),l)
# print(list(m))
#####################################################################################################################
# l = [{'name': line.split()[0], 'sex': line.split()[1], 'age': line.split()[2], 'salary': line.split()[3]}
# for line in f]
# res = filter(lambda name:not name['name'].startswith('a'),l)
# print(list(res))
# [{'name': 'egon', 'sex': 'male', 'age': '18', 'salary': '3000'},
# {'name': 'wupeiqi', 'sex': 'female', 'age': '28', 'salary': '20000'},
# {'name': 'yuanhao', 'sex': 'female', 'age': '28', 'salary': '10000'}]
#####################################################################################################################
#Continue updating****************************************************************************************************