PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 41


Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Choose two.)

Show Answer
Correct Answer: CD

math.floor(2.5) and math.trunc(2.5) both return the largest integer value less than or equal to 2.5, which is 2. Therefore, they evaluate to the same value making the expression math.floor(2.5) == math.trunc(2.5) true. On the other hand, math.hypot(3,4) finds the Euclidean distance from the origin to the point (3,4) which is 5, and math.sqrt(25) calculates the square root of 25, which is also 5. Thus, math.hypot(3,4) == math.sqrt(25) evaluates to true.

Discussion

1 comment
Sign in to comment
DKAT2023Options: CD
Jul 12, 2024

C and D are corrects