'''
1. Write a Python program to remove an item from a tuple.


2. Write a Python program to convert two tuples to a dictionary.
'''
#2. 
t1 = (1,2,3,4,5)
t2 = ('apple' , 'green' , 'orange' , 'blue' , 'red')
d = {}
for i in range(len(t1)):
    d.setdefault(t1[i] , t2[i])
print(d)
print(dict(zip(t1,t2))) # dono same length k hone chahiye

'''
3.  Write a Python program to replace last value of tuples in a list.
    Sample list: [(10, 20, 40), (40, 50, 60), (70, 80, 90 , 50)]
    Expected Output: [(10, 20, 100), (40, 50, 100), (70, 80, 100)]
'''
# 
sl = [(10, 20, 40), (40, 50, 60), (70, 80, 90 , 50)]
eol = []
for i in sl:
    li = list(i)
    li[-1] = 100
    eol.append(tuple(li))
print(eol)
'''
4. Question:
    Write a program that calculates and prints the value according to the given formula:
    Q = Square root of [(2 * C * D)/H]
    Following are the fixed values of C and H:
    C is 50. H is 30.
    D is the variable whose values should be input to your program in a comma-separated sequence.
   Example
    Let us assume the following comma separated input sequence is given to the program:
    100,150,180
    The output of the program should be:
    18,22,24
    
5. Question:
    Write a program that accepts sequence of lines as input and prints the lines after making all characters in the sentence capitalized.
    Suppose the following input is supplied to the program:
    Hello world
    Practice makes perfect
    Then, the output should be:
    HELLO WORLD
    PRACTICE MAKES PERFECT
    
6. Question:
    Write a program that computes the value of a+aa+aaa+aaaa with a given digit as the value of a.
    Suppose the following input is supplied to the program:
    9
    Then, the output should be:
    7380
7. Question:
    Write a program that computes the net amount of a bank account based a transaction log from console input. The transaction log format is shown as following:
    D 100
    W 200

    D means deposit while W means withdrawal.
    Suppose the following input is supplied to the program:
    D 300
    D 300
    W 200
    D 100
    Then, the output should be:
    500
8. Question:
    You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:
    1: Sort based on name;
    2: Then sort based on age;
    3: Then sort by height.
    The priority is that name > age > score.
    If the following tuples are given as input to the program:
    Tom,19,80
    John,20,90
    Jony,17,91
    Jony,17,93
    Json,21,85
    Then, the output of the program should be:
    [('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Json', '21', '85'), ('Tom', '19', '80')]


9. Write a Python program to create and display all combinations of letters, selecting each letter from a different key in a dictionary.
    Sample data : {'1':['a','b'], '2':['c','d']}
    Expected Output: 
    ac
    ad
    bc
    bd

'''
