Consider the statements given below and then choose the correct output from theनीचे दिए गए स्टैटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों (Options) में से
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 = '#' )
नीचे दिए गए स्टैटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों (Options) में से
सही आउटपुट (output) चुनिये :
D={ 'S01 ' : 95, 'S02' : 96 }
for I in D :
print ( I , end = '#' )
Show answerHide answer
Correct answer: (A) S01#S02#S01#S02#
Explanation
Looping over a dictionary gives its keys, not its values. So the loop prints each key followed by '#': S01#S02#.Dictionary पर लूप चलाने से उसकी keys मिलती हैं, मान नहीं। इसलिए लूप हर key के बाद '#' प्रिंट करता है: S01#S02#।