Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

How can you access element 3 in [[1, 2], [3, 4]]?

View

What will d = {'x': {'y': 2}}; d['x']['y'] return?

View

How can you append a new dictionary inside a list?

View

What will tuple([1, [2, 3]]) produce?

View

Can a dictionary value be a list?

View

Which of the following represents a valid nested dictionary?

View

What will be the output of this code?

View

Which data structure allows duplicate values?

View

What will x = (1, [2, 3]); x[1].append(4) produce?

View

Can a tuple contain mutable elements?

View

How can you access element 3 in [[1, 2], [3, 4]]?

list[1][0]
list[2][1]
list[0][1]
list[1][1]

What will d = {'x': {'y': 2}}; d['x']['y'] return?

2
{'y': 2}
'y'
None

How can you append a new dictionary inside a list?

list.append({'key': 'value'})
list.add({'key': 'value'})
dict.update([key, value])
list.insert({'key': 'value'})

What will tuple([1, [2, 3]]) produce?

(1, [2, 3])
[1, [2, 3]]
(1, 2, 3)
Error

Can a dictionary value be a list?

Yes
No

Which of the following represents a valid nested dictionary?

{'a': {'b': 1}}
{'a': ['b', 'c']}
Both a and b
None

What will be the output of this code?

data = {'key': [1, 2, 3]} data['key'].append(4) print(data)

{'key': [1, 2, 3, 4]}
{'key': (1, 2, 3, 4)}
{'key': [1, 2, 4]}
{'key': [1, 2, 3]}

Which data structure allows duplicate values?

Dictionary
List
Set
Tuple

What will x = (1, [2, 3]); x[1].append(4) produce?

(1, [2, 3, 4])
(1, [2, 4])
(1, [2])
Error

Can a tuple contain mutable elements?

Yes
No