Expressions =========== 1. Evaluate manually the following expressions. Then type them in a Python shell and check the result. a) Division .. code:: python 15/3 15//3 17/3 17//3 17%3 -17//3 -17%3 17/-3 -17/-3 b) Priority rules .. code:: python 3*4+2 (3*4)+2 3*(4+2) 7+2**3 7+(2**3) (7+2)**3 2**2**3 2**(2**3) (2**2)**3 c) Boolean expressions .. code:: python 2 > 4 or 2 > 1 2 > 4 and 2 > 1 2 < 4 and not(3 > 5 or 7 < 8) d) Expressions with strings .. code:: python 'How' + ' are ' + 'you ?' 'Fine '*3 'I have '+ str(3) + ' sisters.' 2. Write the following mathematical expressions using the Python syntax (use the minimum number of parenthesis): a) :math:`\frac{x+2y-1}{z}` b) :math:`\frac{4x}{2y+3z}` c) :math:`\frac{5xy}{2z}` d) :math:`\frac{x}{4yz}` e) :math:`\frac{x^5}{3} + \frac{(2x-1)^3}{6} + \frac{x}{12} + 1` f) :math:`\frac{y^3 \tan x}{cos(y^2)-3}` g) :math:`\frac{|8x-4y|}{\sqrt{x^2+cos(y)+4}}` You can find the solution in file :download:`expressions.py`