ynonp / python-examples-verint-2016-07

Python examples and exercises
MIT License
2 stars 35 forks source link

Exercise 2 #177

Open zfigov opened 8 years ago

zfigov commented 8 years ago

It's not clear how to get an index that I can use in the sub function

ynonp commented 8 years ago

Hi, You can use a lambda expression as the second parameter like you did in re.search. Here's a short example: http://stackoverflow.com/questions/18922805/python-lambda-if-statement-re-sub

Why do you need an index?