如何在python中打印%

时间:2018-06-24 17:15:50

标签: python-3.x

我想这样打印输出:
    sapos百分比:25.00% 我编写以下代码:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="form">
  <ul>
    <li><input type="checkbox" name="menu[]" value="2" id="menu">Vehicle
      <ul>
        <li><input type="checkbox" name="submenu[2][1]">Bike</li>
        <li><input type="checkbox" name="submenu[2][2]">Car</li>
        <li><input type="checkbox" name="submenu[2][3]">Cycle</li>
      </ul>
    </li>
    <li><input type="checkbox" name="menu[]" value="12" id="menu">Sport
      <ul>
        <li><input type="checkbox" name="submenu[12][1]">Basketball</li>
        <li><input type="checkbox" name="submenu[12][2]">Volleyball</li>
        <li><input type="checkbox" name="submenu[12][3]">Football</li>
      </ul>
    </li>
  </ul>
  <input type="submit" name="submit" value="submit" class="col100">
</form>

但是没有用。 如何通过python ..在输出中打印“%”?

1 个答案:

答案 0 :(得分:0)

print("Percentual de sapos: {:.2f} %".format(Z))

这个问题重复了:How can I selectively escape...