1. 使用`type()`函数:
```python
x = 5
print(type(x)) 输出:
2. 使用`isinstance()`函数:```pythonx = 5
print(isinstance(x, int)) 输出:True
3. 使用`type()`函数和`isinstance()`函数的组合:
```python
x = 5
if type(x) is int:
print("x is an integer")
else:
print("x is not an integer")
4. 使用`type()`函数和`isinstance()`函数的比较运算符`==`:```pythonx = 5
if type(x) == int:
print("x is an integer")
else:
print("x is not an integer")
5. 使用`type()`函数和`isinstance()`函数的`is`运算符:
```python
x = 5
if type(x) is int:
print("x is an integer")
else:
print("x is not an integer")
6. 使用`type()`函数和`isinstance()`函数的`in`运算符:```pythonx = 5
if type(x) in [int, float, str]:
print("x is an integer, float, or string")
else:
print("x is not an integer, float, or string")
7. 使用`type()`函数和`isinstance()`函数的`and`运算符:
```python
x = 5
if type(x) == int and isinstance(x, int):
print("x is an integer")
else:
print("x is not an integer")
8. 使用`type()`函数和`isinstance()`函数的`or`运算符:```pythonx = 5
if type(x) == int or isinstance(x, int):
print("x is an integer or None")
else:
print("x is not an integer or None")
9. 使用`type()`函数和`isinstance()`函数的`not`运算符:
```python
x = 5
if not type(x) == int:
print("x is not an integer")
else:
print("x is an integer")
10. 使用`type()`函数和`isinstance()`函数的`not in`运算符:```pythonx = 5
if not type(x) in [int, float, str]:
print("x is not an integer, float, or string")
else:
print("x is an integer, float, or string")
11. 使用`type()`函数和`isinstance()`函数的`and not`运算符:
```python
x = 5
if type(x) == int and not isinstance(x, int):
print("x is an integer but not None")
else:
print("x is not an integer or None")
12. 使用`type()`函数和`isinstance()`函数的`or not`运算符:```pythonx = 5
if not type(x) == int or not isinstance(x, int):
print("x is not an integer or None")
else:
print("x is an integer or None")
13. 使用`type()`函数和`isinstance()`函数的`and not in`运算符:
```python
x = 5
if not type(x) == int or not isinstance(x, int):
print("x is not an integer or None")
else:
print("x is an integer or None")
14. 使用`type()`函数和`isinstance()`函数的`or not in`运算符:```pythonx = 5
if not type(x) == int or not isinstance(x, int):
print("x is not an integer or None")
else:
print("x is an integer or None")
15. 使用`type()`函数和`isinstance()`函数的`and not in`运算符:
```python
x = 5
if not type(x) == int or not isinstance(x, int):
print("x is not an integer or None")
else:
print("x is an integer or None")
16. 使用`type()`函数和`isinstance()`函数的`or not in`运算符:

