Computer Science
Answer
The characteristics of dictionary are as follows:
Each key maps to a value — The association of a key and a value is called a key-value pair. However, there is no order defined for the pairs, thus, dictionaries are unordered.
Each key is separated from its value by a colon (:). The items are separated by commas, and the entire dictionary is enclosed in curly braces {}.
Keys are unique and immutable — Keys are unique within a dictionary while values are mutable and can be changed.
Indexed by Keys — The elements in a dictionary are indexed by keys and not by their relative positions or indices.
The value of a dictionary can be of any type, but the keys must be of an immutable data type such as strings, numbers or tuples.
Dictionary is mutable — We can add new items, delete or change the value of existing items.
Related Questions
Write a program to count the frequency of a given element in a list of numbers.
Write a program to check if the smallest element of a tuple is present at the middle position of the tuple.
What are the issues associated with disability while teaching and using computers?
import ............... #Statement 1 a, b, c = 17, 23, 30 s = ............... #Statement 2 area = ............... (s*(s—a)*(s—b)*(s—c)) #Statement 3 print("Sides of triangle:", a, b, c) print(...............) #Statement 4