Commit 1a474266 authored by 张彦钊's avatar 张彦钊

change tets

parent 5b8480ba
......@@ -27,14 +27,8 @@ def get_user_profile():
for i in tmp:
tags[i["content"]] = i["score"]
tags = sorted(tags.items(), key=lambda x: x[1], reverse=True)
tag_score = {}
print(tags)
print(type(tags))
a = tags.keys()
print(a)
if len(tmp) > 5:
for i in list(a)[:5]:
tag_score[i] = tags[i]
if len(tags) > 5:
tag_score = tags[:5]
print(tag_score)
return tag_score
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment