汉字的Unicode编码界于0x4E00和0x9FA5之间。
shzFile = open("水浒传.txt", "r", encoding = "utf-8") hlmFile = open("红楼梦.txt", "r", encoding = "utf-8") sSet = set(shzFile.read()) hSet = set(hlmFile.read()) shzFile.close() hlmFile.close() print(____)
{x for x in (sSet + hSet) if 0x4E00 <= ord(x) <= 0x9FA5 }
{x for x in (sSet | hSet) if 0x4E00 <= x <= 0x9FA5 }
{x for x in (sSet + hSet) if 0x4E00 <= x <= 0x9FA5 }
{x for x in (sSet | hSet) if 0x4E00 <= ord(x) <= 0x9FA5 }