[Tutor] position of an element in list:

2010-07-23 Thread Vineeth Rakesh
Hello all, How to return the position of a character in a string. Say I have str1 = welcome to the world if i want to return the position of the first occurrence of o how to do it? Thanks Vin ___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] Help execution time calculation:

2010-07-14 Thread Vineeth Rakesh
Hello all, I want to calculate the execution time of a program. Say I have a function like below: def RepAdd(i): j = 0 while(ji): j += 1 return j now I want to calculate the execution time of the function RepAdd when say 10 is passed as an argument. I did come across the module

[Tutor] Help return a pattern from list

2010-07-05 Thread Vineeth Rakesh
Hello all, Can some one help me to return a special pattern from a list. say list = [something1.mp3,something2.mp3,something4.pdf,something5.odt] now say I just need to return the files with .mp3 extension. How to go about doing this? Thanks Vin ___