返回首页
/ˈɪtəreɪtər/
迭代器,一种用于遍历集合中元素的对象
记忆技巧
拆分联想
将 'iterator' 拆分为 'I' + 'terate' + 'or'。想象自己在说 'I terate or'(我重复或者),即反复做某事,与迭代的概念相关。
谐音记忆
谐音 '爱她热',想象一个程序员 '爱她热'(热爱迭代器),因为迭代器能高效处理数据。
形象联想
将 'iterator' 想象成一个机器人('or' 结尾),它的任务是在集合中 'iterate'(迭代)移动,像传送带一样逐个处理物品。
例句
In Python, an iterator is an object that allows you to traverse through all the elements of a collection. (在Python中,迭代器是一种允许你遍历集合中所有元素的对象。)