What Will Be The Output Of The Following Python Codep Pre #596
What will be the output of the following Python code?</p> <pre><code class="language-python"> >>> a={i: 'A' + str(i) for i in range(5)} >>> a </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python Dictionary - Python Dictionary - Quiz No.5.
What will be the output of the following Python code?
>>> a={i: 'A' + str(i) for i in range(5)} >>> a
An exception is thrown
{0: ‘A0’, 1: ‘A1’, 2: ‘A2’, 3: ‘A3’, 4: ‘A4’}
{0: ‘A’, 1: ‘A’, 2: ‘A’, 3: ‘A’, 4: ‘A’}
{0: ‘0’, 1: ‘1’, 2: ‘2’, 3: ‘3’, 4: ‘4’}