What is the output of print('{1} and {0}'.format(20, 10)) in Python?
print('{1} and {0}'.format(20, 10))
Correct answer
A. 10 and 20
6 views
A. 10 and 20
6 views
Indexes can be reused in str.format.
Asked in: Python Interview Output Prediction
https://docs.python.org/3/reference/datamodel.htmlNot sure why the answer is A? Ask here and get an explanation.