What Will Be The Output Of The Following Python Codep Pre #394
What will be the output of the following Python code?</p> <pre><code class="language-python"> a="hello" b=list((x.upper(),len(x)) for x in a) print(b) </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 Lists - Python Lists - Quiz No.6.
What will be the output of the following Python code?
a="hello" b=list((x.upper(),len(x)) for x in a) print(b)
[(‘H’, 1), (‘E’, 1), (‘L’, 1), (‘L’, 1), (‘O’, 1)]
[(‘HELLO’, 5)]
[(‘H’, 5), (‘E’, 5), (‘L’, 5), (‘L’, 5), (‘O’, 5)]
Syntax error