Learn 2D array indexing by playing Tic-Tac-Toe! Enter row and column to place your mark.
board = [
["", "", ""], # row 0
["", "", ""], # row 1
["", "", ""] # row 2
]
# Access: board[row][col]
Click on a cell to see a question about accessing it!
Practice array indexing with weather temperature data. What's the index of the highlighted temperature?
temperatures = [22.5, 24.0, 19.8, 28.3, 21.0, 25.5, 23.2]
Click "New Question" to start!
Drag and drop code blocks to build array operations!
scores containing: 85, 92, 78, 95
Create arrays with initial values
Access specific elements by index
Change array elements
for i in range(3):
for i in range(len(arr)):
for row in range(3):
Create a 2D grid structure
Access elements with [row][col]
Drag and drop the code lines into the correct order to build a linear search function!
# Search for a number in an integer array
numbers = [12, 45, 78, 23, 56, 89, 34]
# Call the function to find 23
result = linearSearch(numbers, 23)
print(result) # Should output: 3
# Search for a name in a string array
names = ["Alice", "Bob", "Charlie", "Diana", "Eve"]
# Call the function to find "Charlie"
result = linearSearch(names, "Charlie")
print(result) # Should output: 2
result:
prices = [99, 45, 120, 75, 200]
Find the value 120 using linearSearch()
Test your array skills with timed challenges!
Press Start to begin!