Lets say I have a list:
my_list = ['first', 'second', 'third']
Now what I want to do is run a cmd command that defines a name to this list, but at the same time numbers it. I know this sounds confusing so here is what it would look like:
for i in range (0, 4):
localdevice = cmd("some command create name ARRAY_456_" + i + "")
Now I don’t need the command itself, that I already have, what I need to know is whether my for loop will work and create ARRAY_456_1 then ARRAY_456_2 and then ARRAY_456_3?
Or is there some other way that I can add numbers to the end of this?
Should work but would write it that way
Using string concatenation isn’t that clean. Using format to replace parameters in a string is much more flexible
Here’s a more complete example:
If it’s not what you’re looking for then. I’m not sure to understand the question.