Nothing up here. The good stuff is below.
Powered by Randall
← back to writing
by Randall · 15 Jan 2026·python / study
python用与判断数据类型的函数:
isinstance()函数 isinstance(变量,类型) isinstance(i, int) 可以用来判断变量的类型,它返回的是一个布尔值,False or True.
isinstance()
isinstance(变量,类型)
isinstance(i, int)
type()函数 不是判断变量的类型,而使直接返回变量的类型
type()