Read first
Task 40
Test with real questions
Collect twenty real questions with the answer you expect, then measure the bot against them. A score out of twenty is the only honest measure of quality.
Task
What makes a good test question?
The editor already contains a starting point. Change it until every check passes — the Next task button unlocks when it does.
What you start with
QUESTIONS = [
('What is the Python fee?', 'fee'),
('What are your timings?', 'timing'),
('Where are you in Faisalabad?', 'contact'),
]
def route(question):
q = question.lower()
if 'fee' in q:
return 'fee'
if 'timing' in q or 'time' in q:
return 'timing'
return 'contact'
passed = 0
for question, expected in QUESTIONS:
got = route(question)
if got == expected:
passed += 1
print(question, '->', got, '(expected', expected + ')')
print('score:', passed, 'of', len(QUESTIONS))
Python
1 automatic check Content and quality
Code editor
Ctrl + Enter runs
Run your code to see the output and the checks.
Your result
Submit your code to see results
Write your code in the middle column and press Run code.
Next task (pass every check first)
Hint
Ask yourself: What makes a good test question?