--

Hello! Thanks for reading the post.

So, count is lazy, so, it won’t compute anything when you call it. Try using take(count(start=10, step=1), 10), to get the first 10 numbers it generates.

For islice you’re right. I was trying to name the arguments to make it specific. I fixed it now. Similarly, you should use take to see the results.

For tee I’m guessing that you try to write it as it is. I’m merely giving the definition there, so, in order to use it do something like that:
[list(it) for it in tee([1,2,3,4], 2)] . tee will split the iterable [1,2,3,4] into two parts, on which you should call list to realize.

Hope that helps!

--

--

Dimitris Poulopoulos
Dimitris Poulopoulos

Written by Dimitris Poulopoulos

Machine Learning Engineer. I talk about AI, MLOps, and Python programming. More about me: www.dimpo.me

Responses (1)