Update app.py
Browse files
app.py
CHANGED
|
@@ -10,10 +10,10 @@ def arrange_seating(input_data):
|
|
| 10 |
total_seats = 32
|
| 11 |
empty_seats = total_seats - len(students)
|
| 12 |
|
| 13 |
-
# 如果學生數量少於32
|
| 14 |
if empty_seats > 0:
|
| 15 |
-
students.extend(['
|
| 16 |
-
|
| 17 |
# 隨機打亂學生列表
|
| 18 |
random.shuffle(students)
|
| 19 |
|
|
@@ -39,3 +39,4 @@ with gr.Blocks() as demo:
|
|
| 39 |
|
| 40 |
# 啟動 Gradio 應用
|
| 41 |
demo.launch()
|
|
|
|
|
|
| 10 |
total_seats = 32
|
| 11 |
empty_seats = total_seats - len(students)
|
| 12 |
|
| 13 |
+
# 如果學生數量少於32,補充空位(使用占位符代替空位)
|
| 14 |
if empty_seats > 0:
|
| 15 |
+
students.extend(['-'] * empty_seats) # 用 '-' 來佔位,避免空格
|
| 16 |
+
|
| 17 |
# 隨機打亂學生列表
|
| 18 |
random.shuffle(students)
|
| 19 |
|
|
|
|
| 39 |
|
| 40 |
# 啟動 Gradio 應用
|
| 41 |
demo.launch()
|
| 42 |
+
|