0
0
Intro to Computingfundamentals~10 mins

Why databases organize large data in Intro to Computing - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a simple list of data entries.

Intro to Computing
data = [[1]]
Drag options to blanks, or click blank then click option'
A'apple'
B'apple', 'banana', 'cherry'
Capple, banana, cherry
D['apple', 'banana', 'cherry']
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted words which are not valid strings.
Putting multiple items without commas.
2fill in blank
medium

Complete the code to add a new record to the database list.

Intro to Computing
database = ['record1', 'record2']
database.[1]('record3')
Drag options to blanks, or click blank then click option'
Aadd
Binsert
Cappend
Dextend
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' which is not a list method.
Using 'extend' which expects an iterable, not a single item.
3fill in blank
hard

Fix the error in the code to retrieve the first record from the database list.

Intro to Computing
first_record = database[1]0
Drag options to blanks, or click blank then click option'
A[
B(
C{
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses which are for function calls.
Using curly braces which are for sets or dictionaries.
4fill in blank
hard

Fill both blanks to create a dictionary that organizes data by ID.

Intro to Computing
database = [1] 1: 'Alice', 2: 'Bob', 3: 'Charlie' [2]
Drag options to blanks, or click blank then click option'
A{
B[
C}
D]
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets which are for lists.
Mixing opening and closing brackets incorrectly.
5fill in blank
hard

Fill both blanks to filter records with IDs greater than 1.

Intro to Computing
filtered = {k: v for k, v in database.items() if k [1] [2]
Drag options to blanks, or click blank then click option'
A>
B1
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which means less than.
Using '==' which means equal to.