相異なる文の種類の数(Pythonの場合)
#! /user/local/bin/python import string num = [] chohuku =0 for line in open ('../data_c.txt','r'): if line == 0: break else: num.append(line) num.sort(lambda x, y: cmp(string.lower(x), string.lower(y))) for i in range(len(num)-1): if num[i] == num[i+1]: chohuku += 1 string_num = (len(num) - chohuku-1) print string_num