Hey I need the output to be like this Enter a string: ab GFE%873, 2: Your string contains 17 characters. There are 3 upper case characters. There are…