Examveda
Examveda

What will be the output of the following Python code?
a="hello"
b=list((x.upper(),len(x)) for x in a)
print(b)

A. [('H', 1), ('E', 1), ('L', 1), ('L', 1), ('O', 1)]

B. [('HELLO', 5)]

C. [('H', 5), ('E', 5), ('L', 5), ('L', 5), ('O', 5)]

D. Syntax error

Answer: Option A


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python