1. Home
  2. Data Science
  3. Python
  4. What is the output of print('{1} and {0}'.format(20, 10))…

Added 25 Nov 2026

What is the output of print('{1} and {0}'.format(20, 10)) in Python?

print('{1} and {0}'.format(20, 10))
  1. 10 and 20 Correct answer
  2. 10 and 10
  3. 20 and 20
  4. Error

Correct answer

A. 10 and 20

6 views

MCQSEXAM

Explanation

Indexes can be reused in str.format.

Reference

Asked in: Python Interview Output Prediction

https://docs.python.org/3/reference/datamodel.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs