Spaces:
Build error
Build error
| import gradio as gr | |
| def level_response(choice): | |
| if choice == "Basic": | |
| return "You chose Basic level. Let's start with the fundamentals!" | |
| elif choice == "Intermediate": | |
| return "You chose Intermediate level. Time to go deeper!" | |
| elif choice == "Advanced": | |
| return "You chose Advanced level. You're ready for expert challenges!" | |
| else: | |
| return "Please select a valid option." | |
| with gr.Blocks() as demo: | |
| gr.Markdown("## Choose Your Learning Level") | |
| level = gr.Radio(choices=["Basic", "Intermediate", "Advanced"], label="Select your level") | |
| output = gr.Textbox(label="Response") | |
| submit_btn = gr.Button("Submit") | |
| submit_btn.click(fn=level_response, inputs=level, outputs=output) | |
| demo.launch() | |