# Blender Doesn't Permit Indices in Drivers?

I have a variable in a driver that I would like to be able to "switch on and off". To do this, I figured I could give this variable a power, another variable that would link to a custom property. I can then make the custom property 1, for enabled, or 0 for disabled - as a number to the power 0 is 1 and 1 multiplied by another number is just that other number.

I.e. x^y*z .

However Blender doesn't seem to support this. Here is the error from the console: Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for ^: 'float' and 'float'

Any ideas as to why this is? It seems like pretty standard math to me. If not, any ideas how to get around it?

• simple python syntax error, use ** for power of. – David Jun 16 '16 at 5:14
• not strictly a Blender issue either... this would be equally well at home on stackoverflow: stackoverflow.com/questions/34258537/… – zeffii Jun 16 '16 at 7:45
• I'm voting to close this question as off-topic because it pertains to the meaning and effect of default operator symbols in Python. – zeffii Jun 16 '16 at 7:48
• Or just use x * z if y else x as your driver expression. – batFINGER Jun 16 '16 at 8:53

Your trouble comes from a simple python syntax error. You are using ^ when the syntax in python is ** for power of (^ is the bitwise XOR operator ). As you can see here in the python docs ** is the the correct form.