Search the courses, subjects, tracks, games and features, or jump straight to a page.
Create a list called numbers that holds the five values 12, 7, 9, 15 and 7, then print the list and the number of items in it.
Separate the items with commas inside square brackets.
Start a shopping list with "milk" and "bread", add "eggs" to the end, and print the updated list.
Call the method on the list itself: `shopping_list.append(...)`.
What does sum(numbers) / len(numbers) give when numbers is the list of 10, 20, 30, 40 and 50?
Work out the total and the count first, then divide.
Which list method adds an item to the end of a shopping list?
Think of the method that "appends" something to what is already there.
Store five test scores in a list. Print the average, the highest and lowest scores, and how many scores are above the average.
`max()` and `min()` find the largest and smallest items, and a counter variable that starts at 0 can count matches inside a loop.
Given a finished tic-tac-toe board as a nested list, print it row by row, then check every row, every column and both diagonals and print "X wins", "O wins" or "No winner".
A column is made from the same index in every row: `board[0][i]`, `board[1][i]` and `board[2][i]`.
6 more questions in this section. Enroll free to practise them all.
Enroll free