← Quiz: AI Engineering Capstone: all 10 questions
Quiz: AI Engineering Capstone · Question 6 of 10
What does this print? (code)
What does this print?
def route(question, logged_in_roll):
q = question.lower()
if any(w in q for w in ("my attendance", "my marks", "my result")):
return "tool:get_attendance" if logged_in_roll else "ask_login"
if any(w in q for w in ("fee", "attendance", "hall ticket", "exam")):
return "rag:handbook"
return "ticket:office"
print(route("When do hall tickets come out?", None), route("Show my marks", 7))
- A.ticket:office ask_login
- B.rag:handbook tool:get_attendance
- C.rag:handbook ask_login
- D.tool:get_attendance rag:handbook
Answer & explanation
Correct answer: rag:handbook tool:get_attendance
A general rule question goes to the handbook; a personal question from a logged-in student goes to the tool.
Can you get the rest right without peeking?
Take the timed Quiz: AI Engineering Capstone quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →