logo

AQA A-Level Computer Science practice

Represent the document "Blue blue bird" as a dictionary, ignoring letter case. State the key-value pair for each distinct word and explain what the values represent.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Dictionaries

Exam-style question

Try this first

Represent the document "Blue blue bird" as a dictionary, ignoring letter case. State the key-value pair for each distinct word and explain what the values represent.

Answer and explanation

Concise answer

{"blue": 2, "bird": 1}.

Why this is correct

Each distinct word becomes a key. Its associated value is the number of times that word occurs in the document. The two instances of "Blue" and "blue" are treated as the same word because letter case is ignored.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions