Spaces:
Sleeping
Sleeping
File size: 578 Bytes
7973b29 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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.")
|