[Tutor] Is there a library which has this object?

Yeh yeh at whoosh.cn
Thu Apr 28 14:08:50 EDT 2016


Thank you!

> You probably want to look at the itertools module.
> 
> There you can find among others the count() generator function.
> Others of possible interest include cycle() and repeat()
Yeah, I'm going to check them now.and I just solved my first question by using numpy, as below:
import timeimport numpy as np
start = input("please input the value of start: ")end = input("please input the value of end: ")dur = input("please input the value of dur: ")array = np.linspace(float(start),float(end),1000)dur = float(dur)/len(array)for i in array:    print(float(i))    time.sleep(dur)
But, how to make it become a function?I tried to:def myFunction(start,end,dur):...........for i in array:    return i    time.sleep(dur)
as you see, I failed...
Thanks again!
 		 	   		  


More information about the Tutor mailing list