python中访问列表元素
访问列表 (Accessing a list)
To access a list – we can simply print the list object and the complete list prints as an output.
要访问列表,我们可以简单地打印列表对象,然后将完整的列表作为输出打印。
print (list_object)
Example:
例:
In this example, we will declare and assign the list, will print their types, and will print the list. To find the type of an object – we use type() method.
在此示例中,我们将声明并分配列表,打印其类型,并打印列表。 要找到对象的类型–我们使用type()方法 。