Search Header Logo
Midtest

Midtest

Assessment

Presentation

World Languages

KG

Practice Problem

Hard

Created by

joeee joeee

Used 2+ times

FREE Resource

1 Slide • 4 Questions

1

media

​reference code to finish test

2

Multiple Choice

Joe wants to add the number 6 to the end of the list.

Which one of the following is the correct way to do so?

1. numbers.add(6)
2. numbers.append(6) 3. numbers.push(6) 4. numbers.put(6)
Find the same example code as option

1

fruits.append('grape') print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']

2

fruits.pop() print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']

3

fruits.remove('apple') print(fruits) # ['banana', 'kiwi', 'banana', 'pear', 'apple', 'orange']

4

print(fruits[1]) # 'kiwi'

3

Multiple Choice

Joe changes his mind. That is, he does not end up adding 6 to the end of the list. Instead, Joe wants to remove the last number 2 from the end of the list.
Which one of the following is the correct way to do so?

1. numbers.pop()
2. numbers.delete() 3. numbers.erase() 4. numbers.remove()

1

fruits.append('grape') print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']

2

fruits.pop() print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']

3

fruits.remove('apple') print(fruits) # ['banana', 'kiwi', 'banana', 'pear', 'apple', 'orange']

4

print(fruits[1]) # 'kiwi'

4

Multiple Choice

Joe now also wants to remove the first number 1 from the list. Which one of the following is the correct way to do so?

1. numbers.pop(1)
2. numbers.delete(1) 3. numbers.erase(1) 4. numbers.remove(1)

1

fruits.append('grape') print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']

2

fruits.pop() print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']

3

fruits.remove('apple') print(fruits) # ['banana', 'kiwi', 'banana', 'pear', 'apple', 'orange']

4

print(fruits[1]) # 'kiwi'

5

Multiple Choice

Joe wants to retrieve the second number 5 from the list.

Which one of the following is the correct way to do so?

1. numbers[1] 2. numbers[2] 3. numbers[5]

1

fruits.append('grape') print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']

2

fruits.pop() print(fruits) # ['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']

3

fruits.remove('apple') print(fruits) # ['banana', 'kiwi', 'banana', 'pear', 'apple', 'orange']

4

print(fruits[1]) # 'kiwi'

media

​reference code to finish test

Show answer

Auto Play

Slide 1 / 5

SLIDE