What Is String Formatting?

What are the main purposes of string formatting in Maya Python ?
Can you give simple examples as well ?

got a example of what you mean, are you talking about the .format method on strings or string interpolation?

name = "passerby"
age = 32

# String interpolation example
msg = f"hello i am {name} my age is {age}"
print(msg)

# formatting example
msg2 = "hello i am {} my age is {}".format(name, age)
print(msg2)

its purpose is just easily letting you create strings, that have variable inside of them.

Thank you, very helpful !!!

Is this the Chris Cunninham that grew up in Alamo CA ??

Its a pretty common name, I’m Canadian grew up in Nova Scotia.

String formatting is super-useful for combining node names:

for node in some_node_list:
  for attr in attr_list:
    cmds.setAttr("{}.{}".format(node, attr), 0)
    # in python 3: cmds.setAttr(f"{node}.{attr}", 0)