Python matematik.remainder() Yöntem
Örnek
x'in kalanını y'ye göre döndür:
# Import math Library
import math
# Return the remainder of x/y
print (math.remainder(9, 2))
print (math.remainder(9,
3))
print
(math.remainder(18, 4))
Tanım ve Kullanım
Yöntem math.remainder()
, x'in y'ye göre kalanını döndürür.
Sözdizimi
math.remainder(x, y)
Parametre Değerleri
Parameter | Description |
---|---|
x | Required. The number you want to divide. |
y | Required. The number you want to divide with. It must be a non-zero number, or a ValueError occurs. |
Teknik detaylar
Geri dönüş değeri: | float Kalanı temsil eden bir değer |
---|---|
Python Sürümü: | 3.7 |
Daha fazla örnek
Örnek
x/y'nin kalanını döndür:
print (math.remainder(23.5, 5))
print
(math.remainder(23, 5.5))
print (math.remainder(12.5, 2.5))
print
(math.remainder(12, 2))