摘要: The iterator protocol is used to define a standard way that an object produces a sequence of values. What that really means is you now have a process 阅读全文
posted @ 2017-11-21 15:20 Zhentiw 阅读(210) 评论(0) 推荐(0)
摘要: Write a function, remove_duplicates that takes a list as its argument and returns a new list containing the unique elements of the original list. The 阅读全文
posted @ 2017-11-21 14:52 Zhentiw 阅读(352) 评论(0) 推荐(0)
摘要: Let's introduce a new string method, join: Also note thatjoin will trigger an error if we try to join anything other than strings. For example: 阅读全文
posted @ 2017-11-21 14:45 Zhentiw 阅读(508) 评论(0) 推荐(0)
摘要: In addition to accessing individual elements from a list we can use Python's slicing notation to access a subsequence of a list. Consider this list of 阅读全文
posted @ 2017-11-21 14:02 Zhentiw 阅读(355) 评论(0) 推荐(0)