logo-MindMajix
PostPythonPython
v
victoria mamidi

Posted on 24th July 2024|48 views

0
votes

Python Print Percentage

How can I print a percentage value in python?

print str(float(⅙))+% which is showing 0.0% when the actual answer is 16.66% what can I do?

 

1 answers
Answers
P
Surya kumar

Posted on 24th July 2024| views

'{:.1%}'.format(1/6.0)

Output:

‘16.66%’

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number