459,816 views
32 votes
32 votes
In the following expression, identify variables, values, and operators. Evaluate the result of the expression (assume that the value of the variable X is 1).

Variable(s):
Values(s):
Operator(s):

Result of the expression:

User Manneorama
by
2.8k points

1 Answer

16 votes
16 votes

Answer:

The assignment statement creates new variables and gives them values:

>>> message = "What's up, Doc?"

>>> n = 17

>>> pi = 3.14159

This example makes three assignments. The first assigns the string "What's up, Doc?" to a new variable named message. The second gives the integer 17 to n, and the third gives the floating-point number 3.14159 to pi.

The assignment operator, =, should not be confused with an equals sign (even though it uses the same character). Assignment operators link a name, on the left hand side of the operator, with a value, on the right hand side. This is why you will get an error if you enter:

Step-by-step explanation:

User Arianna
by
3.2k points