Article From:https://www.cnblogs.com/kexb/p/9967801.html
mdf_itm_list = [{"name": "n1", "age": 1}, {"name": "n2", "age": 2}, {"name": "n3", "age": 3},
                {"name": "n4", "age": 4}, ]
obj_fs = [mdf_itm_list[i] for i in range(len(mdf_itm_list)) if mdf_itm_list[i]["age"] >= 3]
obj_dict = {mdf_itm_list[i]["name"] :mdf_itm_list[i]["age"] for i in range(len(mdf_itm_list)) if mdf_itm_list[i]["age"] >= 3}
obj_max=max( [mdf_itm_list[i]["age"] for i in range(len(mdf_itm_list))])
obj_join_list = [mdf_itm_list[i]["age"] + mdf_itm_list2[j]["age"]
for i in range(len(mdf_itm_list))
for j in range(len(mdf_itm_list2))
if mdf_itm_list[i]["name"] == mdf_itm_list2[j]["name"]]
seq = ("r", "u", "n", "o", "o", "b") # String sequence
join_str= ("-".join( seq ))
list=["r","o","b"]
join_str2= ("-".join( list ))

str_split_list= str_split.split(',')

 

Link of this Article: Python syntax

Leave a Reply

Your email address will not be published. Required fields are marked *