Spaces:
Runtime error
Runtime error
import streamlit as st | |
import random | |
def convert_alexandre_time(minutes): | |
multiplier = random.uniform(2.5, 4) | |
return int(minutes * multiplier) | |
st.set_page_config(page_title="Alexandre's Time Converter", page_icon="⏰") | |
st.title("🕰️ Alexandre's Time Converter 🕰️") | |
st.subheader("Convert Alexandre's optimistic estimates into reality!") | |
st.write(""" | |
Ever wondered how long Alexandre *really* means when he says he'll be there in '5 minutes'? | |
Wonder no more! Use this handy converter to translate Alexandre's time estimates into more... shall we say... realistic expectations. | |
""") | |
alexandre_time = st.number_input("Enter Alexandre's estimated time (in minutes):", min_value=1, value=5, step=1) | |
if st.button("Convert Alexandre Time"): | |
real_time = convert_alexandre_time(alexandre_time) | |
st.success(f"Alexandre says: {alexandre_time} minutes") | |
st.error(f"Reality says: {real_time} minutes") | |
if real_time > 60: | |
hours = real_time // 60 | |
minutes = real_time % 60 | |
st.warning(f"That's {hours} hour{'s' if hours > 1 else ''} and {minutes} minute{'s' if minutes != 1 else ''}! Better grab a book or start a new hobby!") | |
excuse = random.choice([ | |
"I got caught in a time vortex!", | |
"My watch must be running on Alexandre Standard Time.", | |
"I had to help an old lady cross the street... five times.", | |
"I was abducted by aliens who wanted to learn about punctuality.", | |
"I found a shortcut that turned out to be a longcut.", | |
]) | |
st.info(f"Alexandre's excuse: '{excuse}'") | |
st.markdown("---") | |
st.write("Remember, time is relative... especially when it comes to Alexandre!") |