Computer Science, asked by Xyzuserxyz, 1 month ago

Write a menu driven program to perform following operation on tuple
1. Insert elemnts
2. Reverse tuple
3. Lenths of tuple
4. Take another tuple nad join
5. Smallest nd greatest numbers
6. Create dictionary with tuple elemnts as key and list elemsnts as values
7. Exit

Answers

Answered by ghanshyamkoche786
2

Explanation:

  1. Parameter, Description. pos, Required. A number specifying in which position to insert the value. elmnt, Required.
  2. Since tuples are immutable, there is no way to reverse a tuple in-place. Creating a copy requires more space to hold all of the existing elements. Therefore, this exhausts memory.
  3. Python tuple method len() returns the number of elements in the tuple. Syntax. Following is the syntax for len() method −
  4. Write a function called join_tuple_string that takes a tuple as arguments and return a string. ... Join the tuples in the list using map(join_tuple_string, list) method. Convert the result to list. Print the result.
  5. We know that a four digit number has four places, i.e., thousands, hundreds, tens and ones or units from left to right as Th, H, T, O. If greatest to lowest digits are placed at these places in descending order, we get the greatest number and if placed in ascending order, we get the smallest number
  6. Extend the list by appending all the items from the iterable. ... Return zero-based index in the list of the first item whose value is equal to x. Raises ... list. sort (*, key=None, reverse=False ).
  7. 1 [exit entry 1] : a departure from a stage. 2a : the act of going out or away made an early exit. b : death. 3 : a way out of an enclosed place or space. 4 : one of the designated points of departure from an expressway.
Answered by saloni8182sing
1

Answer:

reverse of tuple to driven program to perform

Similar questions