def reclass(oldClass):
if oldClass in ('1A', '2A'):
return '1'
elif oldClass in ('1B', '2B'):
return '2'
elif oldClass in ('1C', '2C', '3'):
return '3'reclass(!Class!)
def speed(roadType): if roadType == 'US': return 55 elif roadType == 'I': return 70 elif roadType == ... return ...
speed(!road_type!)
def speed(RouteType): if RouteType == 'I', 'PKWY': return 70 elif RouteType == 'US', 'KY': return 55 elif RouteType == 'CNTY': return 45 elif RouteType == 'CITY', 'OTHR': return 35 elif RouteType == 'PRIV': return 25
if RouteType == 'I' or RouteType == 'PKWY':
return 70
...
#alternatively:
if RouteType in ('I', 'PKWY'):
return 70
...