number-squarer / app.py
Sujatha's picture
Create app.py
e798fc2 verified
raw
history blame contribute delete
454 Bytes
import gradio as gr
# Function to calculate the square of a number
def square_number(number):
return number ** 2
# Gradio interface
interface = gr.Interface(
fn=square_number, # Function to call
inputs="number", # Input type (numeric input)
outputs="number", # Output type (numeric output)
title="Number Squarer",
description="Enter a number, and the app will return its square!"
)
# Launch the interface
interface.launch()