Search Header Logo

9th Grade - 05 March 2025

Authored by Eugene Castro

Computers

9th Grade

Used 2+ times

9th Grade - 05 March 2025
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

57 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following correctly accesses the value of key "name" in the dictionary mydict?

mydict("name")
mydict["name"]
mydict.get("name")
mydict.name

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

If you have a dictionary person = {"name": "Alice", "age": 25}, what does person.get("age") return?

It returns 25
It returns an empty string
It returns None
It returns a list of keys

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Given car = {"brand": "Ford", "model": "Mustang", "year": 1964}, how do you access the "year" using a safer approach without an error if absent?

car["year"]
car("year")
car.get("year")
car["year"].value

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which method returns all the values in a dictionary?

keys()
values()
items()
getvalues()

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In Python, which method returns a list containing the key-value pairs of a dictionary?

pairs()
lists()
items()
keyvalue()

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How do you change the value of "year" to 2021 in the dictionary car = {"brand": "Ford", "model": "Mustang", "year": 1964}?

car["year"] = 2021
car("year") = 2021
car.update["year"] = 2021
car = {"year": 2021}

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which dictionary method can be used to change multiple items at once?

renew()
update()
modify()
change()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?