Count unique values in Python list

后端 未结 1 369
孤街浪徒
孤街浪徒 2020-12-20 09:14

I have the following code I\'ve been working on, but I can\'t seem to find a way to count the number of unique values in the anagram list. If I just print out: print l

相关标签:
1条回答
  • 2020-12-20 09:35

    Use a set. sets hold only unique values:

    print len(set(anagram))
    
    0 讨论(0)
提交回复
热议问题