Find solutions to your problems with the expert advice available on IDNLearn.com. Discover trustworthy solutions to your questions quickly and accurately with help from our dedicated community of experts.
def main():
my_string = input("Enter a sentence: ").lower()
character = ""
count = 0
for x in my_string:
if x.isalpha():
if my_string.count(x)>count:
count = my_string.count(x)
character = x
print("The most popular character,",character,"appears",count,"time(s)")
main()
I wrote my code in python 3.8. I hope this helps