Python中可以使用以下方法来判断字符串:
1. `isalpha()`:判断字符串是否只包含字母。
```python
s = "hello"
print(s.isalpha()) # True
s = "hello123"
print(s.isalpha()) # False
```
2. `isdigit()`:判断字符串是否只包含数字。
```python
s = "123"
print(s.isdigit()) # True
s = "hello123"
print(s.isdigit()) # False
```
3. `isalnum()`:判断字符串是否只包含字母和数字。
```python
s = "hello123"
print(s.isalnum()) # True
s = "hello!@#"
print(s.isalnum()) # False
```
4. `islower()`:判断字符串是否只包含小写字母。
```python
s = "hello"
print(s.islower()) # True
s = "Hello"
print(s.islower()) # False
```
5. `isupper()`:判断字符串是否只包含大写字母。
```python
s = "HELLO"
print(s.isupper()) # True
s = "Hello"
print(s.isupper()) # False
```
6. `isspace()`:判断字符串是否只包含空格。
```python
s = " "
print(s.isspace()) # True
s = "hello world"
print(s.isspace()) # False
```