Issue
I've recently learned that the " % " sign is used to calculate the remainder of an integer in Python. However I was unable to determine if there's another operator or method to calculate percent in Python.
Like with " / " which will give you the quotient, if you just use a float for one of the integers, it will actually give you the answer like traditional division. So is there a method to work out percentage?
Solution
There is no such operator in Python, but it is trivial to implement on your own. In practice in computing, percentages are not nearly as useful as a modulo, so no language that I can think of implements one.
Answered By - Rafe Kettler
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.