AI Computer Science Academy · Faisalabad

AI & Prompt Engineering

Summarise simply

Task 49 of 56 Python Real work and portfolio
All tasks
Read first Task 49

Summarise simply

A summary is choosing the sentences that matter. Splitting on full stops and taking the first two is the simplest version — and it works for notices.

Task

What does a summary keep?

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
text = 'Admission is open. Classes run Monday to Saturday. Fees are per month. Bring your CNIC copy.'

sentences = [s.strip() for s in text.split('.') if s.strip()]
print(len(sentences), 'sentences')
print('summary:', sentences[0] + '. ' + sentences[1] + '.')
Python 1 automatic check Real work and portfolio
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)