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

What will be the output of the following Python code?
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
 

Tìm kiếm

Back
Top