String Python字符串初始化[';Hello World';]和';你好';世界';分歧

String Python字符串初始化[';Hello World';]和';你好';世界';分歧,string,arrays,String,Arrays,我开始学习Python版本3,并在解释器中尝试了以下代码 $ python3 Python 3.6.8 (default, Apr 9 2019, 04:59:38) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> Justring = 'Hello World' >>> Justring[2] 'l' >

我开始学习Python版本3,并在解释器中尝试了以下代码

$ python3 
Python 3.6.8 (default, Apr  9 2019, 04:59:38) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> Justring = 'Hello World' 
>>> Justring[2]
'l'
>>> Justring = ['Hello World']
>>> Justring[0]
'Hello World'
>>> Justring[1]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> 
$python3
Python 3.6.8(默认值,2019年4月9日,04:59:38)
linux上的[GCC 8.3.0]
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>贾斯汀=‘你好,世界’
>>>贾斯汀[2]
“我
>>>Justing=['Hello World']
>>>贾斯汀[0]
“你好,世界”
>>>贾斯汀[1]
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
索引器:列表索引超出范围
>>> 
在这些情况下,字符串Justring的初始化有什么不同

[“你好,世界”]

“你好,世界”


我从哪里可以得到这样的解释

快速答案是方括号表示列表

[“hello world”]
是一个包含一个字符串的列表。所以第一个索引是整个字符串。第二个索引超出范围,因为列表中只有一项


请使用
[“hello world”,“hello Reach”]
再试一次,您将看到有一个额外的有效索引

谢谢你的快速回复。我开始研究六种类型的数据。字符串,列表,字典等。谢谢,我会拿起的。