Create a streamlit application with blue header and text in white saying my app, below a drop-lisy field with randon data
To upload files, please first save the app
import streamlit as st
import numpy as np
# Set page config to dark theme
st.set_page_config(page_title="My App", layout="wide")
# Custom CSS to change header color and text color
st.markdown("""
<style>
.main {
color: white;
}
.stMarkdown {
color: white;
}
h1 {
color: #0068c9;
}
</style>
""", unsafe_allow_html=True)
# Header
st.title("My App")
# Generate some random data for the dropdown
random_options = [f"Option {i}" for i in range(1, 11)]
random_values = np.random.randint(1, 100, size=10)
options_dict = dict(zip(random_options, random_values))
# Create dropdown
selected_option = st.selectbox(
"Select an option:",
options=random_options
)
# Display the selected value
st.write(f"The value for {selected_option} is: {options_dict[selected_option]}")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?