indexing and slicing of tuples done

A. How is indexing and slicing of tuples done? B. Which operator is used to access the elements in a

A. How is indexing and slicing of tuples done? 

B. Which operator is used to access the elements in a tuple?

C.  Can a programmer pass a variable to a function? If yes, how? 10. What is the function of zip()?

D. What is the role of the * operator within the zip() function?

E.  Describe the basics of dictionaries. 1. Write a function which takes a tuple as a parameter and returns a new tuple as the output, where every other element of the input tuple is copied, starting from the fi rst one.

T = (‘Hello’,’Are’,’You’,’Loving’,’Python?’)

Output_Tuple = (‘Hello’, ‘You’, ‘Python?’)

Leave a Reply

Your email address will not be published.