Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def calculate_bill(total_amount, num_people
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
per_person = final_amount / num_people
|
| 7 |
-
return f"Total with tip: {final_amount:.2f}\nEach person pays: {per_person:.2f}"
|
| 8 |
|
| 9 |
iface = gr.Interface(
|
| 10 |
fn=calculate_bill,
|
| 11 |
inputs=[
|
| 12 |
gr.Number(label="Total Bill Amount"),
|
| 13 |
gr.Number(label="Number of People"),
|
| 14 |
-
gr.Number(label="Tip Percentage"),
|
| 15 |
],
|
| 16 |
outputs="text",
|
| 17 |
-
title="Bill Split Calculator"
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
iface.launch()
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def calculate_bill(total_amount, num_people):
|
| 4 |
+
per_person = total_amount / num_people
|
| 5 |
+
return f"Total Bill: {total_amount:.2f}\nEach person pays: {per_person:.2f}"
|
|
|
|
|
|
|
| 6 |
|
| 7 |
iface = gr.Interface(
|
| 8 |
fn=calculate_bill,
|
| 9 |
inputs=[
|
| 10 |
gr.Number(label="Total Bill Amount"),
|
| 11 |
gr.Number(label="Number of People"),
|
|
|
|
| 12 |
],
|
| 13 |
outputs="text",
|
| 14 |
+
title="Bill Split Calculator",
|
| 15 |
+
description="Enter the total bill amount and the number of people to split the bill equally."
|
| 16 |
)
|
| 17 |
|
| 18 |
iface.launch()
|
| 19 |
+
|