Hello, You can pass an operator as an argument to your function.
See : http://docs.python.org/library/operator.html Regards, ---------- Forwarded message ---------- From: <[email protected]> Date: 2012/5/24 Subject: Dynamic comparison operators To: [email protected] I would like to pass something like this into a function test(val1,val2,'>=') and it should come back with True or False. Is there a way to dynamically compare 2 values like this or will I have to code each operator individually? -- http://mail.python.org/mailman/listinfo/python-list
-- http://mail.python.org/mailman/listinfo/python-list
