-2

I want to print output like that:
Percentual de sapos: 25.00 % I write this following code:

print("Percentual de sapos: %i.2f %"%Z)

But it didn't work. How to print "%" in output by python..?

Rakibul Islam
  • 167
  • 1
  • 2
  • 14
  • Duplicate of [How can I selectively escape percent (%) in Python strings?](https://stackoverflow.com/questions/10678229/how-can-i-selectively-escape-percent-in-python-strings). – WhoIsJack Jun 24 '18 at 17:18
  • 3
    Possible duplicate of [How can I selectively escape percent (%) in Python strings?](https://stackoverflow.com/questions/10678229/how-can-i-selectively-escape-percent-in-python-strings) – Mureinik Jun 24 '18 at 17:21

1 Answers1

1

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

This question is duplicated:How can I selectively escape...

Fred Guth
  • 1,537
  • 1
  • 15
  • 27