Test |
CISC106 /
ExpressionsPython is interactive (show IDLE prompt) Simple program: 3 + 2 Python computes: 5 built-in operators/functions: +, *, -, / pow, abs pow(2,3)
for math functions need to do: from math import *
sin(0)
cos(pi)
sqrt(9)
OR import math math.sin(0)
math.cos(math.pi)
math.sqrt(9)
Combine and nest expressions: sin(3 * pi / 2)
# sin(3pi/2) is an error
abs(sin(3 * pi / 2))
|