Test Index

CBSE Class 12 Computer Science 2025 Paper Set 4 Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 8 of 37
Marks: +1, -0
Consider the statements given below and then choose the correct output from the given options :
D={'S01':95, 'S02':96 }
for I in D :
print(I,end='#')
Solution:  
Concept:
A for loop over a dictionary goes through its keys (in insertion order).
Explanation:
I takes the values 'S01' and then 'S02'; each is printed followed by '#' instead of a new line.
S01#S02#
Key point: To get the values use D.values() or D[I]; to get both use D.items().
Answer:
Option A (S01#S02#)
© examsnet.com
Advertisements
Go to Question: