Exercise 2.3. Assume that we execute the following assignment statements:

width = 17
height = 12.0
delimiter = ‘.’
For each of the following expressions, write the value of the expression and the type (of the value of
the expression).
1. width/2
2. width/2.0
3. height/3
4. 1 + 2 * 5
5. delimiter * 5

 

Lab description:

In this lab, we learn how the basic operations in Python works and how to solve math problems.

 

>>> width = 17
>>> height = 12.0
>>> delimiter = ‘.’
>>> width/2
8
>>> width/2.0
8.5
>>> height/3
4.0
>>> 1 + 2 * 5
11
>>> delimiter * 5
‘…..’
>>>

 

KU{3ZZY8)4V244_))F{SYJX