following problem:
i have a string i want to execute like:
string = “2*A+B”
usually it should work like result = exec string.
when i try that in dynamo i receive only error messages.
any clue?
following problem:
i have a string i want to execute like:
string = “2*A+B”
usually it should work like result = exec string.
when i try that in dynamo i receive only error messages.
any clue?
Please show a screenshot…
Generally you cannot perform math on strings… (Neither in Python nor in Dynamo)
But using strings will give wrong results, at least that’s was what I meant in my original reply 

Alternatively you can import the “math” module in Python

dimitar thank you for your reply.
just found out that it is a problem with dynamo 2+
going back to 1.3 everything is working.
btw code is just the same as your smple 
tx peter
dimitar, asfaik math is not capable of calculating strings… true?
It seems that it is repeated the number of times that your formula states?
E.g. “NAF*2” is repeated twice…
Can you show your entire script and possibly the input from Dynamo if you have that? It would make it easier to understand… 
If any of your input arguments are strings and you want to use math on them, you’ll first have to convert them to a numeric object. For example:
A = float(“1.23”)
B = float(“4.56”)
dimitar thank you.
thought that even variables shall be string.
by converting them to numbers solved the problem