How to shorten the float result I got? I only need 2 digits after the dot. Sorry I really don\'t know how to explain this better in English...
Thanks
I hope this will help.
def do(*args): formattedList = [float("{:.2f}".format(num)) for num in args] _result =(sum(formattedList)) result = round(_result,2) return result print(do(23.2332,45.24567,67,54.27))
Result:
189.75