100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

WGU C949 Key Exam Guide Questions and Integral Marking Scheme version 2024/2025

Rating
-
Sold
-
Pages
25
Grade
A+
Uploaded on
12-11-2024
Written in
2024/2025

WGU C949 Key Exam Guide Questions and Integral Marking Scheme version 2024/2025 Dictionary key characteristic - correct answer They are unique and immutable. Dictionary method - correct answer D1[key]. remove(value) () - correct answer returns a view object that yields (key, value) tuples. () - correct answer returns a view object that yields dictionary keys. s() - correct answer returns a view object that yields dictionary values. Dict for loop - correct answer A for loop over a dict retrieves each key in the dict. ie.. for key in dictionary: dict operations - correct answer my_dict[key] Indexing operation - retrieves the value associated with key. john_grade = my_dict['John'] my_dict[key] = value Adds an entry if the entry does not exist, else modifies the existing entry. my_dict['John'] = 'B+' del my_dict[key] Deletes the key entry from a dict. del my_dict['John'] key in my_dict Tests for existence of key in my_dict if 'John' in my_dict: # ... dict methods - correct answer my_() Removes all items from the dictionary my_dict = {'Bob': 1, 'Jane': 42} my_() print(my_dict) {} my_(key, default) Reads the value of the key entry from the dict. If the key does not exist in the dict, then returns default. my_dict = {'Bob': 1, 'Jane': 42} print(my_('Jane', 'N/A')) print(my_('Chad', 'N/A')) 42 N/A my_e(my_dict2) Merges dictionary my_dict with another dictionary my_dict2. Existing entries in my_dict1 are overwritten if the same keys exist in my_dict2. my_dict = {'Bob': 1, 'Jane': 42} my_e({'John': 50}) print(my_dict) {'Bob': 1, 'Jane': 42, 'John': 50} my_(key, default) Removes and returns the key value from the dictionary. If key does not exist, then default is returned. my_dict = {'Bob': 1, 'Jane': 42} val = my_('Bob') print(my_dict) {'Jane': 42}

Show more Read less
Institution
WGU C949 Data Structure And Algorithm
Course
WGU C949 Data Structure and Algorithm










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
WGU C949 Data Structure and Algorithm
Course
WGU C949 Data Structure and Algorithm

Document information

Uploaded on
November 12, 2024
Number of pages
25
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

WGU C949 Key Exam Guide Questions and
Integral Marking Scheme version 2024/2025

Dictionary key characteristic - correct answer They are
unique and immutable.


Dictionary method - correct answer D1[key]. remove(value)


dict.items() - correct answer returns a view object that yields
(key, value) tuples.


dict.keys() - correct answer returns a view object that yields
dictionary keys.


dict.values() - correct answer returns a view object that
yields dictionary values.


Dict for loop - correct answer A for loop over a dict retrieves
each key in the dict.
ie.. for key in dictionary:


dict operations - correct answer my_dict[key]
Indexing operation - retrieves the value associated with key.
john_grade = my_dict['John']


my_dict[key] = value

,Adds an entry if the entry does not exist, else modifies the
existing entry.
my_dict['John'] = 'B+'


del my_dict[key]
Deletes the key entry from a dict.
del my_dict['John']


key in my_dict
Tests for existence of key in my_dict
if 'John' in my_dict: # ...


dict methods - correct answer my_dict.clear()
Removes all items from the dictionary
my_dict = {'Bob': 1, 'Jane': 42}
my_dict.clear()
print(my_dict)
{}


my_dict.get(key, default)
Reads the value of the key entry from the dict. If the key does not
exist in the dict, then returns default.
my_dict = {'Bob': 1, 'Jane': 42}
print(my_dict.get('Jane', 'N/A'))
print(my_dict.get('Chad', 'N/A'))
42

, N/A


my_dict1.update(my_dict2)
Merges dictionary my_dict with another dictionary my_dict2.
Existing entries in my_dict1 are overwritten if the same keys
exist in my_dict2.
my_dict = {'Bob': 1, 'Jane': 42}
my_dict.update({'John': 50})
print(my_dict)
{'Bob': 1, 'Jane': 42, 'John': 50}


my_dict.pop(key, default)
Removes and returns the key value from the dictionary. If key
does not exist, then default is returned.
my_dict = {'Bob': 1, 'Jane': 42}
val = my_dict.pop('Bob')
print(my_dict)
{'Jane': 42}


Underlying data structures: Binary search tree, Hash table -
correct answer Set, Dictionary(Map)


Underlying data structures: Heap - correct answer Priority
queue


Underlying data structures: Linked list, Array - correct
answer Bag, Queue, List

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
KieranKent55 NONE
View profile
Follow You need to be logged in order to follow users or courses
Sold
41
Member since
2 year
Number of followers
18
Documents
6124
Last sold
3 weeks ago

3.6

9 reviews

5
4
4
1
3
2
2
0
1
2

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions