Skip to content
OtisamLMS
Computing

Computing · Quick practice · answer shown after each question

Python lists, functions and libraries

Question 1 of 10

Question 1 of 10

Write a Python function called area that takes the length and width of a rectangle and returns its area. Show how to call it.

Question 2 of 10

Question 2 of 10

len(["a", "b", "c"]) returns ___.

Question 3 of 10

Question 3 of 10

In the list fruits = ["mango", "orange", "pawpaw"], what is fruits[0]?

Question 4 of 10

Question 4 of 10

What is the result of [1, 2] + [3]?

Question 5 of 10

Question 5 of 10

What does sum([2, 4, 6]) return?

Question 6 of 10

Question 6 of 10

Python list indexes start at 0.

Question 7 of 10

Question 7 of 10

The keyword that sends a value back from a function is ___.

Question 8 of 10

Question 8 of 10

Write a program that simulates rolling a die ten times and prints each result.

Question 9 of 10

Question 9 of 10

What does len([4, 8, 15, 16]) return?

Question 10 of 10

Question 10 of 10

The first item in a Python list has index ___.

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