久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      python利用format方法保留三位小數(shù)

      python利用format方法保留三位小數(shù)

      format方法是內(nèi)置的python字符串格式化方法。

      基本語法為:str.format(),它增強(qiáng)了字符串格式化的功能。

      基本語法是通過 {} 和 : 來代替以前的 % 。

      format 函數(shù)可以接收多個(gè)參數(shù),位置可以不按順序。

      具體實(shí)例如下:

      >>> print("{:.0f}".format(3.1415926)) 3 >>> print("{:.2f}".format(3.1415926)) 3.14 >>> print("{:.3f}".format(3.1415926)) 3.142

      推薦教程:python教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)