SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Y Daniel Lang
Chapter:
Functions Strings And Objects
Exercise:
Check Point
Question:1 | ISBN:978013274719 | Edition: 6

Question

Evaluate the following functions:

(a) math.sqrt(4)                     (j) math.floor(-2.5)
(b) math.sin(2 * math.pi)       (k) round(3.5)
(c) math.cos(2 * math.pi)      (l) round(-2.5)
(d) min(2, 2, 1)                      (m) math.fabs(2.5)
(e) math.log(math.e)             (n) math.ceil(2.5)
(f) math.exp(1)                      (o) math.floor(2.5)
(g) max(2, 3, 4)                     (p) round(-2.5)
(h) abs(-2.5)                          (q) round(2.6)
(i) math.ceil(-2.5)                   (r) round(math.fabs(-2.5))

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

import math
a = math.sqrt(4)
print(a)
b = math.sin(2 * math.pi)
print(b)
c = math.cos(2 * math.pi)
print(c)
d = min(2, 2, 1)
print(d)
e = math.log(math.e)
print(e)
f = math.exp(1)
print(f)
g = max(2, 3, 4)
print(g)
h = abs(-2.5)
print(h)
i = math.ceil(2.5)
print(i)
j = math.floor(-2.5)
print(j)
k = round(3.5)
print(k)
l = round(-2.5)
print(l)
m = math.fabs(2.5)
print(m)
n = math.ceil(2.5)
print(n)
o = math.floor(2.5)
print(o)
p = round(-2.5)
print(p)
q = round(2.6)
print(q)
r = round(math.fabs(-2.5))
print(r)
0 0

Discussions

Post the discussion to improve the above solution.