Examveda

What will be the output of the following Python code?
l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)

A. Error

B. "a='H', b='O', c=(E, L)"

C. "a=H, b=O, c=['E', 'L']"

D. Junk value

Answer: Option C


This Question Belongs to Python Program >> Formatting And Decorators

Join The Discussion

Related Questions on Formatting and Decorators