#NoPayJan Offer - Access all CloudxLab Courses for free between 1st to 31st JanEnroll Now >>
Python provides us with a module called
math which has certain functions and variables that help us in doing mathematical calculations. Functions in
math module return
float values. Before we can use the module, we have to import it:
print(math) and see the result. (You need to import math before printing)
To access one of the functions, we need to specify the name of the module and the name of the function, separated by a dot (also known as a period). This format is called
It will calculate
log to the base 10 and return
3.0 in this case. The math module also provides a function called
log that computes logarithms to the base e.
It will find the
cosine of radians and return
1.0 in this case. The name of the variable is a hint that
cos and the other trigonometric functions (
tan, etc.) take arguments in radians.
math.pi gets the variable
pi from the math module. The value of this variable is an approximation of π, accurate to about 15 digits. To convert from degrees to radians, divide by 360 and multiply by 2π.
It will calculate the square root of 4 and return 2.0 here.
56.98and store it in the variable
26 degreesinto radians and store it to
26 degreesand store it in the variable
1000and store it in the variable
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here