Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Cisco Certified DevNet Associate (DEVASC) · Cisco
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
D. dict The json.loads(json_string) function in Python converts a JSON-formatted string into a Python dictionary (dict).
The right answer is D. Dictionaries are analogous to "hashes" in some other languages. A dictionary is a data structure that stores simple key-value pairs. They make it very easy and fast to store and retrieve a value by supplying a key to be used as an index for that value. Values: The values in a Python dictionary can be anything, and like lists the types don't have to be consistent. Keys: A dictionary's keys have an important restriction: Whatever you want to use as a key has to be immutable and hash-able. This means that you could use a tuple as a key (immutable), but not a list (mutable). Also note that all of the basic data types that you learned about previously (int, float, bool, str, bytes ) are immutable and can be used as dictionary keys. You create a dictionary by using curly braces {] , separating a key from its value with a colon : , and separating the key-value pairs with commas. You can access and update elements using indexing; however, instead of using numerical sequential index numbers, you use the key as the index. You can add new elements simply by assigning a value to a new key.
In this exercise they only wanted to know if you know what does the "loads" function returns.. and it returns a dictionary in python