Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| st.set_page_config(page_title="Word & Letter Counter", layout="centered") | |
| st.title("π Word & Letter Counter") | |
| text = st.text_area( | |
| "Enter your text below:", | |
| height=200, | |
| placeholder="Type or paste your text here..." | |
| ) | |
| if text: | |
| words = text.split() | |
| word_count = len(words) | |
| letter_count = len(text.replace(" ", "")) | |
| st.subheader("π Results") | |
| st.write(f"**Words:** {word_count}") | |
| st.write(f"**Letters (excluding spaces):** {letter_count}") | |
| else: | |
| st.info("Please enter some text to count words and letters.") | |