Get a subset of a generator

后端 未结 0 463
误落风尘
误落风尘 2021-02-12 05:14

I have a generator function and want to get the first ten items from it; my first attempt was:

my_generator()[:10]

This doesn\'t work because g

相关标签:
回答
  • 消灭零回复
提交回复
热议问题