Reference to Part of List - Python

后端 未结 4 1165
暖寄归人
暖寄归人 2020-12-11 02:01

If I have a list in python, how can I create a reference to part of the list? For example:

myList = [\"*\", \"*\", \"*\",  \"*\", \"*\", \"*\", \"*\", \"*\",         


        
4条回答
  •  旧时难觅i
    2020-12-11 02:23

    Use a slice object or an islice iterator?

    http://docs.python.org/library/functions.html#slice

提交回复
热议问题