There are a few restrictions on naming. You can not start with a number. You can not have whitespaces, or special characters. You can however put a number in the name after the first character.
int $myInt = 1;It is important to remember to place a semicolon at the end of each statement. This is how Maya knows when one command statement starts and another begins.
string $myString = "Hello Jello";
If you are unsure what a variable type is, use the whatIs command to find out.
int $myInt = 1;You can assign a value to a variable by getting information using the query command
// Result: int variable //
float $ballRadius = `polySphere -query -radius "myBall"`;
Exercise:Create a variable for a the name of a cube. Make a polyCube using the variable. Make variables for height, width and depth. Edit the polyCube using the new variables.