Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random as rd
|
| 3 |
|
| 4 |
-
def add2List(num):
|
| 5 |
aList = []
|
| 6 |
bList = []
|
| 7 |
num = int(num)
|
|
|
|
|
|
|
|
|
|
| 8 |
for i in range(num):
|
| 9 |
r = rd.randint(1,100)
|
|
|
|
| 10 |
aList.append(r)
|
| 11 |
bList.append(r)
|
| 12 |
bList.sort()
|
|
@@ -14,5 +18,5 @@ def add2List(num):
|
|
| 14 |
MIN = min(aList)
|
| 15 |
return aList,bList,MAX,MIN
|
| 16 |
|
| 17 |
-
iface = gr.Interface(fn=add2List, inputs="text", outputs=["text","text","text","text"])
|
| 18 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random as rd
|
| 3 |
|
| 4 |
+
def add2List(num,startRand,endRand):
|
| 5 |
aList = []
|
| 6 |
bList = []
|
| 7 |
num = int(num)
|
| 8 |
+
startRand = int(startRand)
|
| 9 |
+
endRand = int(endRand)
|
| 10 |
+
|
| 11 |
for i in range(num):
|
| 12 |
r = rd.randint(1,100)
|
| 13 |
+
r = rd.randint(startRand,endRand)
|
| 14 |
aList.append(r)
|
| 15 |
bList.append(r)
|
| 16 |
bList.sort()
|
|
|
|
| 18 |
MIN = min(aList)
|
| 19 |
return aList,bList,MAX,MIN
|
| 20 |
|
| 21 |
+
iface = gr.Interface(fn=add2List, inputs=["text","text","text"], outputs=["text","text","text","text"])
|
| 22 |
iface.launch()
|