romanovamar / bio-python

0 stars 0 forks source link

task3 #3

Closed romanovamar closed 6 years ago

YakutovDmitriy commented 6 years ago

All functions except repeatntimes are ok.

Try to test the following call and think about why it gives such result repeatntimes(squares([1, 2, 3]), 2)

romanovamar commented 6 years ago

Ok, I get why it happens. I changed it a bit.

YakutovDmitriy commented 6 years ago

Lets executethe following code:

for elem in repeatntimes(itertools.count(), 2):
    if elem % (10 ** 6) == 0:
        print(elem)

Your implementation gets MemoryError after about 68 million operations. This is because you spend infinite memory if your input is infinite. Try to avoid it. itertools docs can help you

romanovamar commented 6 years ago

Ok, then I just use tee.

YakutovDmitriy commented 6 years ago

Almost ok. But I can't run your function. Please fix it

romanovamar commented 6 years ago

Done, I guess

YakutovDmitriy commented 6 years ago

Good :)