def cost_per_click(spend, clicks):
 if clicks:
  return (float(spend) / clicks)
 else:
  return 0

def cost_per_click ( spend , clicks ) : if clicks : return ( float ( spend ) / clicks ) else : return 0
return the cost-per-click given ad spend and clicks .