HW4Q3

 avatar
user_7676782
python
2 years ago
479 B
3
Indexable
Never
def checkMaxChar(str1):
    myMax = 0
    i = 0
    while i < len(str1):
        j = i + 1
        charCounter = 1
        while j < len(str1):

            if str1[i] == str1[j]:
                charCounter += 1
            j += 1

        if charCounter > myMax:
            myMax = charCounter
            char = str1[i]
        i += 1
    print(charCounter, myMax)


def main():
    myStr = input("Enter a string: ")
    checkMaxChar(myStr)


main()