在Python中,定义一个字符串变量可以通过以下几种方法:
1. 使用单引号(`'`):
```python
str_variable = 'Hello, World!'
2. 使用双引号(`"`):
```python
str_variable = "Hello, World!"
3. 使用三引号(可以是三个单引号`'''`或三个双引号`"""`),用于创建多行字符串:
```python
str_variable = '''This is a multi-line string.
It can contain multiple lines of text.'''
请注意,在Python中,字符串是不可变的,这意味着一旦定义了一个字符串,它的值就不能被修改