I want to create a string name with Example: Length of 'teststring', i.e. "test string lamp" length = 15 I do not know What to do with C, but in Python, you can do this: It is not very secure, even if a malicious user If able to provide an arbitrary string, it can run arbitrary python code. Another option There are some warnings for its use (see for more information; see also Gabe's comment below for possible improvement). / P> Finally, the preferred solution is usually to use a dictionary instead of multiple variables: inserting two other small stars and then I want to use his content.
teststring = "teststringlength" len ("test" + "string")
eval ('len ({} {})' format ('test', 'string')) < / Code>
locals () :
local () ['test' + 'string']
data = {'teststring': 'teststringlength'} len ( Data ['test' + 'string'])
No comments:
Post a Comment