This code will generally not run, as there is nothing inside of the
( and
) of the
print statement. Try displaying the result
of the following comparisons (using the variables a,b,c,d and x) using the
print statement:
- Is $\pi^2$ < 10?$ (hint:
print(math.pi^2 < 10))
- Is $b^2>b$?
- Is $\pi^2 > a$?
- Is $a+b == b+a$?
- Is $b-a > 0$?
- Is $a-a=0$?
- Is $ab+0 == ab$?
- Is $1*a == a$?
- Is $0+a==a$?
- Is $(a+b)(a-b)==a^2-b^2$?
- Is $(a+b)(a+b)==a^2+2ab+b^2$?
- If $a>c$ and $c>d$ then is $a>d$ (use 3
print statements for this one)?
- If $a>b$ then is $1/a>1/b$?
- Is $e^x>1+x$ for any value of $x$? (Hint: $e^x$ is
math.exp(x) in computer programming).
- Is $x^x\ge\left(\frac{1}{e}\right)^\frac{1}{e}$ for any value of $x$?
- Is $a^a+b^a\ge a^b+b^a$?
- Is $(1+x)^r\ge 1+rx$ (for any number $r$)?
Hint: Don't forget that computers don't know how to multiple automatically. So, something like $2ab$ has to be programmed in as
2*a*b.