szabivan

python (a?)^na^n on a^n

Feb 4th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. from timeit import Timer
  2.    
  3. for n in range(30) :
  4.     t = Timer ('re.match("a?"*'+str(n)+' + "a"*'+str(n)+' , "a"*'+str(n)+' )', "import re")
  5.     print("n = " + str(n) + "\ttime = " + str(t.timeit(1)))
Advertisement
Add Comment
Please, Sign In to add comment