Q. Which of the following statements would yield 2? Assume that math module is imported. Recall that math.fabs() gives you absolute value of its argument.


(a) print(5/2)
(b) print(5.0//2)
(c) print((int) ( 5 //2))
(d) print(math.fabs (-5.0 / 2))
(e) print(math.fabs ( -5 // 2))
(f) print(math.fabs(-3//2))
(g) print(-5/2)
(h) print(-5/2)
(i) print (-5//2)
(j) print(-5.0//2)

Answer :-

Statement (c) will give output 2 because int () function convert decimal number into integer number.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post