Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Python code snippets vol 38:
- 188-Calculate percentage
- stevepython.wordpress.com
- requirements: None
- source:
- https://docs.python.org/3/library/string.html#module-string
- """
- points = 10
- total = 300
- print('Percentage of points from total is: {:.2%}'.format(points/total))
- #Output:
- #>>>Percentage of points from total is: 3.33%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement