Discover a wealth of information and get your questions answered on IDNLearn.com. Whether your question is simple or complex, our community is here to provide detailed and trustworthy answers quickly and effectively.
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