File size: 758 Bytes
8e6f243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()