Consider the statements given below and then choose the correct output from…
2025
Consider the statements given below and then choose the correct output from the given options: D = {'S01': 95, 'S02': 96} for l in D: print(l, end="#")
- A.
S01#S02#
- B.
95#96#
- C.
S01,95#S02,96#
- D.
S01#95#S02#96#
Attempted by 75 students.
Show answer & explanation
Correct answer: A
In Python, iterating directly over a dictionary (for i in D) returns keys by default.
Using print(i, end="#") prints each key followed by #.
Hence, output is S01#S02#.