'Python humanfriendly stop printing "and"

Pythons humanfriendly library prints in the format "1 day, 6 hours and 19 minutes", is there a way to stop it from printing the "and" word?

So I want it to print "1 day, 6 hours, 19 minutes"



Solution 1:[1]

From the documentation, you can't do that natively with the library.

You could simply replace the "and" yourself though.

>>> "1 day, 6 hours and 19 minutes".replace(" and ", ", ")
'1 day, 6 hours, 19 minutes'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Loocid