🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

Python में truncation करने के लिए कौन सा method प्रयोग किया जाता है?

Which method is used to truncate a number in Python?

A
round()
B
floor()
C
ceil()
D
math.trunc()
Explanation

Truncation का मतलब है किसी decimal संख्या से fractional हिस्सा हटा देना — यानी केवल integer part को रखना, बिना round किए।

Python में truncation के लिए इस्तेमाल होता है: math.trunc()


🔹 Example / उदाहरण:

 

import math

print(math.trunc(5.89))   # Output: 5
print(math.trunc(-3.14))  # Output: -3

➡ यह सिर्फ integer part को रखता है, भले ही number positive हो या negative।

Correct Answer: D) math.trunc()

Latest Updates