letter-counter / app.py
Shankarm08's picture
Update app.py
fc8aba8 verified
raw
history blame contribute delete
466 Bytes
import gradio as gr
def letter_counter(word, letter):
word = word.lower()
letter = letter.lower()
return word.count(letter)
demo = gr.Interface(
fn=letter_counter,
inputs=["textbox", "textbox"],
outputs="number",
title="Letter Counter",
description="Enter text and a letter to count how many times the letter appears in the text."
)
if __name__ == "__main__":
demo.launch(mcp_server=True) # This is the key part to enable MCP