is 判斷 id() 是不是相同 == 判斷值是否相等 isinstance() 會查找繼承鏈,判斷類型。 使用 type()的話會有誤差。 使用 isinstance() 而不是 type() 來判斷類型。