python list in list
时间: 2023-10-12 18:05:19 浏览: 138
In Python, you can create a list of lists by nesting lists inside another list. Here's an example:
```python
my_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
```
In this example, `my_list` is a list that contains three sublists. Each sublist represents a row of elements. You can access individual elements using indexing. For instance, `my_list` will give you `[1, 2, 3]`, and `my_list` will give you `6`.
阅读全文