iscasebalancedstring

CF

Function isCaseBalancedString

The function/method isCaseBalancedString accepts an argument str. The string str contains only alphabets.The function/method…