Examveda

What will be the output of the following Python code?
s=["pune", "mumbai", "delhi"]
[(w.upper(), len(w)) for w in s]

A. Error

B. ['PUNE', 4, 'MUMBAI', 6, 'DELHI', 5]

C. [PUNE, 4, MUMBAI, 6, DELHI, 5]

D. [('PUNE', 4), ('MUMBAI', 6), ('DELHI', 5)]

Answer: Option D


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python