AI Computer Science Academy · Faisalabad

AI & Prompt Engineering

Log and read

Task 19 of 56 Python Prompt engineering
All tasks
Read first Task 19

Log and read

Save every question and answer. The log is how you find the questions your bot cannot answer — the list becomes your next ten lessons and your next ten FAQ entries.

Task

Why log the questions?

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
log = []

def log_it(question, reply):
    log.append('Q: ' + question)
    log.append('A: ' + reply[:40])

log_it('What is the AI fee?', 'Rs 15,000 per month, payable monthly.')
log_it('Timing?', 'Monday to Saturday, 10:00 to 20:00.')
print(len(log), 'lines')
print('\n'.join(log))
Python 1 automatic check Prompt engineering
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.

Checks on this task:

  • Check 1

Track progress

0 of 56 tasks complete

Next task unlocks when every check passes.

Sign in to keep your code and certificates.

Next task (pass every check first)