Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import random | |
| # Function to generate a cat name based on breed and characteristics | |
| def generate_cat_name(breed, characteristic): | |
| breed_names = { | |
| "Persian": ["Fluffy", "Cleo", "Pearl", "Snowball"], | |
| "Siamese": ["Luna", "Suki", "Milo", "Kiki"], | |
| "Maine Coon": ["Thor", "Bear", "Leo", "Maple"], | |
| "Bengal": ["Zara", "Blaze", "Hunter", "Cleo"], | |
| "Sphynx": ["Gizmo", "Baldwin", "Nala", "Pixie"] | |
| } | |
| characteristic_modifiers = { | |
| "Playful": ["the Jester", "Pounce", "Bounce", "Whiskers"], | |
| "Quiet": ["the Silent", "Shadow", "Muffin", "Dusk"], | |
| "Naughty": ["Trouble", "Rascal", "Mischief", "Chaos"], | |
| "Loyal": ["Buddy", "Faith", "Noble", "Guardian"], | |
| "Curious": ["Explorer", "Scout", "Peek", "Wonder"] | |
| } | |
| base_name = random.choice(breed_names.get(breed, ["Kitty"])) | |
| modifier = random.choice(characteristic_modifiers.get(characteristic, ["Furball"])) | |
| return f"{base_name} {modifier}" | |
| # Streamlit App | |
| st.title("Cat Name Generator") | |
| st.write("Select your cat's breed and characteristics to generate the perfect name!") | |
| # User inputs | |
| breed = st.selectbox( | |
| "Choose your cat's breed:", | |
| ["Persian", "Siamese", "Maine Coon", "Bengal", "Sphynx"] | |
| ) | |
| characteristic = st.selectbox( | |
| "Choose your cat's characteristic:", | |
| ["Playful", "Quiet", "Naughty", "Loyal", "Curious"] | |
| ) | |
| # Generate and display the cat name | |
| if st.button("Generate Name"): | |
| cat_name = generate_cat_name(breed, characteristic) | |
| st.success(f"Your cat's name is: {cat_name}") |