CBSE Class 11 Computer Science Question 87 of 112

Dictionaries — Question 9

Back to all questions
9
Question

Question 9(a)

Predict the output:

d = dict()
d['left'] = '<'
d['right'] = '>'
print('{left} and {right} or {right} and {left}')
Answer
Output

{left} and {right} or {right} and {left}

Explanation

The argument of print function is a string as it is enclosed in single quotes. Hence, it will get printed as is on the screen.