python: get number without decimal places -


  a = 123.45324  

क्या कोई फ़ंक्शन है जो केवल < कोड> 123

हमेशा शून्य की ओर छोटा होगा:

  & gt; & gt; & gt; ए = 123.456 & gt; & gt; & gt; इंट (ए) 123> gt; & gt; & gt; ए = 0.9999 & gt; & gt; & gt; इंट (ए) 0>> gt; & gt; Int (-1.5) -1  

int के बीच का अंतर है और यह है कि math.floor नंबर एक फ्लोट के रूप में देता है, और शून्य की ओर कटौती नहीं करता।


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

wpf - Custom Message Box Advice -

AJAX doesn't send POST query -