Long Answer Type Questions (5 Marks each)

Computer Science - Class 11
Chapter 10 Class 11 - Tuples and Dictionaries

## tup1 = ((1,3),(4,5),(2,9),(1, 10))  tup2=((6,7),(3,9),(1,1),(7,3))

Answer:

``` # Define the tuples tup1 and tup2 that store the coordinates of two geometric figures ```

``` tup1 = ((1,3),(4,5),(2,9),(1, 10)) ```

``` tup2 = ((6,7),(3,9),(1,1),(7,3)) ```

``` # Initialize an empty tuple to store the coordinates of the new figure ```

``` tup3 = () ```

``` # Use a for loop to iterate over the indices of the tuples ```

``` for i in range(len(tup1)): ```

```     # Use the + operator to add the corresponding coordinates of tup1 and tup2 and create a new tuple ```

```     coord = (tup1[i][0] + tup2[i][0], tup1[i][1] + tup2[i][1]) ```

```     # Use the + operator to append the new tuple to tup3 ```

```     tup3 = tup3 + (coord,) ```

``` # Print the value of tup3 using the print() function ```

``` print("The new tuple containing the coordinates of the new figure is", tup3) ```

Made by

#### Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.