Re: how best to use a dictionary in this function?

2008-10-04 Thread Tim Roberts
Terrence Brannon [EMAIL PROTECTED] wrote: Now, I improved this function this way: def calc_profit(std_clicks, vip_clicks, ad_rate=200, upline_status=None): clicks = {} clicks['std'] = std_clicks clicks['vip'] = vip_clicks You can also write it this way. clicks = { 'std':

how best to use a dictionary in this function?

2008-10-02 Thread Terrence Brannon
Ok, here is some code: def calc_profit(std_clicks, vip_clicks, ad_rate=200, upline_status=None): payout = {} payout_std = std_clicks * rates['std'].per_click payout_vip = vip_clicks * rates['vip'].per_click ... now note that std_clicks and vip_clicks are passed to the function.

Re: how best to use a dictionary in this function?

2008-10-02 Thread Aaron Castironpi Brady
On Oct 2, 4:18 am, Terrence Brannon [EMAIL PROTECTED] wrote: Ok, here is some code: def calc_profit(std_clicks, vip_clicks, ad_rate=200, upline_status=None):     payout = {}     payout_std = std_clicks * rates['std'].per_click     payout_vip = vip_clicks * rates['vip'].per_click ... now