Jun-15-2017, 11:54 PM
(Jun-15-2017, 07:43 PM)buran Wrote:(Jun-15-2017, 06:42 PM)emrebt39 Wrote: You divide all args to 10.If i use each arg in different process,what can ido?e.g my args are :x y and z.i will divide x to 10 but divide y to 20...but in the OP(Jun-14-2017, 08:58 PM)emrebt39 Wrote: And i want to divide each arg to 10 and put args in if else condition.If else try part 2maybe you should decide what you want first :-) this is very broad - it depends what your overall goal is. most simple - make separate if for each arg, but I would do something like thisargs = [5000, 200, 70000] divisors = [10, 20, 25] benchmarks = [40, 20, 60] for arg, divisor, benchmark in zip(args, divisors, benchmarks): print('{} / {} = {} :: benchmark {}'.format(arg, divisor, arg/divisor, benchmark)) if arg/divisor > benchmark: print('bigger') else: print('smaller')
Output:5000 / 10 = 500.0 :: benchmark 40 bigger 200 / 20 = 10.0 :: benchmark 20 smaller 70000 / 25 = 2800.0 :: benchmark 60 bigger
Thank you Buran.You are guru :)