G`J 发表于 2020-11-29 11:07:18

本帖最后由 G`J 于 2020-12-1 22:30 编辑

逃兵 发表于 2020-11-29 11:17:55

word1 = input('请输入第一个单词:')

word2 = input('请输入第二个单词:')

if set(word1) == set(word2):
   
    print('is an anagram')
   
else:
   
    print('is not an anagram')

_2_ 发表于 2020-11-29 12:08:02

# Python ver: 3.8 or later
print("Is an anagram.") if set(word1 := input("1st word: ")) == set(word2 := input("2st word: ")) else print("Is not an anagram.")

疾风怪盗 发表于 2020-11-29 21:19:15

https://blog.csdn.net/qq_25264951/article/details/73917635
【python + word2vec】计算语义相似度
页: [1]
查看完整版本: