python打印变量类型
Declare different types of variables; print their types, ids and variables in Python.
声明不同类型的变量; 在Python中打印其类型,id和变量。
There are two inbuilt functions are using in the program:
程序中使用了两个内置函数:
type() - its returns the data type of the variable/object.
type() -返回变量/对象的数据类型 。
id() - it returns the unique identification number (id) of created object/variable.
id() -返回创建的对象/变量的唯一标识号(id) 。
Program:
程序:
print("Numbers")
print("---------------------------------")
a=10
print(type(a),id(a),a)
a=23.7
print(type(a),id(a),a)
a=