python正常函数
1)定义:def+函数名称+参数
#动态查找元素
def find_element(driver,locator,timeout=10):
return WebDriverWait(driver,timeout).until(lambda s:s.find_element(*locator))
2)调用:
find_element(driver,locator,timeout)
python匿名函数
1)定义:lamdba+参数+表达式
func=lamdba x,y:x+y
2)调用:
func(2,3)