Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def check_number(num):
|
| 4 |
+
# Check if the number is within the range [1, 10]
|
| 5 |
+
if 1 <= num <= 10:
|
| 6 |
+
return True
|
| 7 |
+
else:
|
| 8 |
+
return False
|
| 9 |
+
|
| 10 |
+
# Create the Gradio Interface
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=check_number,
|
| 13 |
+
inputs=gr.Number(label="Enter a number"),
|
| 14 |
+
outputs=gr.Label(label="Result"),
|
| 15 |
+
title="Range Checker",
|
| 16 |
+
description="Enter a number to see if it's between 1 and 10."
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
if __name__ == "__main__":
|
| 20 |
+
demo.launch()
|