Spaces:
Runtime error
Runtime error
random_choice_F_codingbat
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def random_choice_F_codingbat():
|
2 |
+
from random import choice
|
3 |
+
|
4 |
+
codingbat_dict={"Warmup-1":12,"Warmup-2":9,"String-1":11,"String-2":6,"List-1":12,"List-2":6,"Logic-1":9,"Logic-2":7}
|
5 |
+
key=choice(list(codingbat_dict.keys()))
|
6 |
+
val=choice(list(range(1,codingbat_dict[key]+1)))
|
7 |
+
print(f"codingbat selection: {key}_{val}")
|
8 |
+
|
9 |
+
return f"codingbat selection: {key}_{val}"
|
10 |
+
|
11 |
+
random_choice_F_codingbat();
|
12 |
+
|
13 |
+
import gradio as gr
|
14 |
+
demo=gr.Interface(fn=random_choice_F_codingbat, inputs=None, outputs="text")
|
15 |
+
demo.launch()
|