طريقة بايثون math.sqrt ()
مثال
أوجد الجذر التربيعي لأرقام مختلفة:
# Import math Library
import math
# Return the square root of
different numbers
print (math.sqrt(9))
print (math.sqrt(25))
print
(math.sqrt(16))
التعريف والاستخدام
تُرجع math.sqrt()
الطريقة الجذر التربيعي لرقم.
ملاحظة: يجب أن يكون الرقم أكبر من أو يساوي 0.
بناء الجملة
math.sqrt(x)
قيمه المعامل
Parameter | Description |
---|---|
x | Required. A number to find the square root of. If the number is less than 0, it returns a ValueError. If the value is not a number, it returns a TypeError |
تفاصيل تقنية
قيمة الإرجاع: | قيمة float تمثل الجذر التربيعي لرقم |
---|---|
نسخة بايثون: | 1.4 |