Q. Create a tuple names as given here:

names = ('Bobby', 'Hoshiar', 'Ekta', 'Astha', 'Dave', 'Lily')

 

For the following steps, use names and slice notation:

(a) Write an expression that produces this new tuple: ('Ekta', 'Asthu', 'Dare')

(b) Write an expression that produces this new tuple: ('Bobby')

(c) Write an expression that produces this new tuple: ('Astha', 'Dave', 'Lily')

 

Answer =

 

(a) names [2 : 5 ]

(b) names [ 0 ]

(c) names [3 : ]

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post