Informatics Practices

Assertion (A): Items in dictionaries are unordered.

Reasoning (R): You may not get back the data in the same order in which you had entered the data initially in the dictionary.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Dictionaries

1 Like

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
In Python, items in dictionaries are unordered. Dictionaries do not maintain the order of elements as they are inserted. When retrieving data from a dictionary, the order of elements returned may not match the order in which they were inserted.

Answered By

1 Like


Related Questions