[英]How do i take out specific data from my list and store in a individual variable
I have a list that look like this我有一个看起来像这样的列表
myList = [2,4,6,8]
I want to take out the specific element from the list and store it in another variable我想从列表中取出特定元素并将其存储在另一个变量中
a = myList[3]
print (a)
By right the answer should give me 6 but i do not understand why it keep giving me error.正确的答案应该给我6,但我不明白为什么它一直给我错误。
Could anyone help me out?谁能帮帮我?
Use:利用:
a = myList[2]
List elements are assigned indexes [0,1,2,....]列表元素被分配索引 [0,1,2,....]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.