I am trying to understand how groupby works. In fact I try to solve a hacker rank problem ("Compress the String !")

When I look at the discussion, one gives an answer in writing 

```
from itertools import groupby

print(*[(len(list(c)), int(k)) for k, c in groupby(input())])

```

and it works. As i understand, the code transform the input into an iterator, and so he run into and print the things he wants.

But when I transform it into 

```
from itertools import groupby
iter = groupby(input())
print(*[(len(list(c)), int(k)) for k, c in iter])

```

it doesn't print nothing. I think this is very strange, but essentially due to a lack of knowledge of myself. And I don't understand well the explanation of the python library.

Can someone enlighten me ?

Thanks,
Gautier