We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用字典并保持顺序
l1 = ['b','c','d','b','c','a','a'] l2 = list(set(l1)) //应改成 l2={}.fromkeys(l1).keys() l2.sort(key=l1.index) print l2
The text was updated successfully, but these errors were encountered:
>>> l1=['b','c','d','c','a','a'] >>> l2=list(set(l1)) >>> l2.sort(key=l1.index) >>> print(l2) ['b', 'c', 'd', 'a']
我在python3上运行没有问题
Sorry, something went wrong.
No branches or pull requests
用字典并保持顺序
l1 = ['b','c','d','b','c','a','a']
l2 = list(set(l1)) //应改成 l2={}.fromkeys(l1).keys()
l2.sort(key=l1.index)
print l2
The text was updated successfully, but these errors were encountered: