What will be the output the following Python code?

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question
100%
In Python
What will be the output the following Python code?
test = {1: 'A', 2: 'B', 3: 'C'}
del test [1]
test [1] = 'D'
del test [2]
print (len (test))
OA 1
OB.0
OC. key value pair 1:"A" is deleted so error will display
OD.2
Transcribed Image Text:What will be the output the following Python code? test = {1: 'A', 2: 'B', 3: 'C'} del test [1] test [1] = 'D' del test [2] print (len (test)) OA 1 OB.0 OC. key value pair 1:"A" is deleted so error will display OD.2
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,