Computer Science, asked by anoushi8342, 1 year ago

Create following variables float _no to contain 2.5

Answers

Answered by rupesh4726
0

Answer:

Explanation:

Evaluating expressions

An expression is a combination of values, variables, and operators. If you type an expression on the command line, the interpreter evaluates it and displays the result:

>>> 1 + 1

2

The evaluation of an expression produces a value, which is why expressions can appear on the right hand side of assignment statements. A value all by itself is a simple expression, and so is a variable.

>>> 17

17

>>> x

2

Confusingly, evaluating an expression is not quite the same thing as printing a value.

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

>>> message

"What's up, Doc?"

>>> print message

What's up, Doc?

When the Python shell displays the value of an expression, it uses the same format you would use to enter a value. In the case of strings, that means that it includes the quotation marks. But the print statement prints the value of the expression, which in this case is the contents of the string.

In a script, an expression all by itself is a legal statement, but it doesn’t do anything. The script

17

3.2

"Hello, World!"

1 + 1

Similar questions