Skip to content
OtisamLMS
Computing

Computing · Quick practice · answer shown after each question

Python: strings, lists and dictionaries

Question 1 of 10

Question 1 of 10

Which statement adds a new entry to a dictionary d?

Question 2 of 10

Question 2 of 10

sort() returns a new sorted list and leaves the original unchanged.

Question 3 of 10

Question 3 of 10

split() turns a string into a list.

Question 4 of 10

Question 4 of 10

What does [10, 20, 30, 40][1:3] return?

Question 5 of 10

Question 5 of 10

What does "Kumasi".find("m") return?

Question 6 of 10

Question 6 of 10

What is nums after nums = [4, 5, 6]; nums.pop()?

Question 7 of 10

Question 7 of 10

Python list indexes can be negative to count from the end.

Question 8 of 10

Question 8 of 10

A Python structure that stores key–value pairs is a ___.

Question 9 of 10

Question 9 of 10

The in operator can test whether an item is in a list.

Question 10 of 10

Question 10 of 10

Write a function that checks whether a word is a palindrome (reads the same backwards), such as "level".

Questions written by OtisamLMS in the style of the WASSCE. They are not WAEC past questions.