Spaces:
Running
Running
to lowercase
Browse files
app.py
CHANGED
@@ -69,13 +69,13 @@ def combine(a, b):
|
|
69 |
return f"{a}{b}"
|
70 |
|
71 |
|
72 |
-
def check(
|
73 |
-
|
74 |
-
ans_correct =
|
75 |
correct += ans_correct
|
76 |
total += 1
|
77 |
|
78 |
-
info = "正確" if ans_correct else f"錯誤 - {
|
79 |
msg = f"{correct}/{total} - " + info
|
80 |
|
81 |
return correct, total, msg, ""
|
|
|
69 |
return f"{a}{b}"
|
70 |
|
71 |
|
72 |
+
def check(kana: str, roma: str, correct, total):
|
73 |
+
kana_roma = to_roma(kana)
|
74 |
+
ans_correct = kana_roma == roma.lower()
|
75 |
correct += ans_correct
|
76 |
total += 1
|
77 |
|
78 |
+
info = "正確" if ans_correct else f"錯誤 - {kana} ({kana_roma})"
|
79 |
msg = f"{correct}/{total} - " + info
|
80 |
|
81 |
return correct, total, msg, ""
|