Exercise No. 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

COMPUTER

PROGRAMMING
MODULE
EXERCISES

l
Name: _______________________________ Section: ________________

1. Concatenate two lists in the following order

list1 = ["Hello ", "take "]


list2 = ["Dear", "Sir"]

Expected output:

['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir']

2. Below are the two lists convert it into the dictionary

keys = ['Ten', 'Twenty', 'Thirty']


values = [10, 20, 30]

Expected output:

{'Ten': 10, 'Twenty': 20, 'Thirty': 30}

3. Merge following two Python dictionaries into one

ict1 = {'Ten': 10, 'Twenty': 20, 'Thirty': 30}


dict2 = {'Thirty': 30, 'Fourty': 40, 'Fifty': 50}

Expected output:

{'Ten': 10, 'Twenty': 20, 'Thirty': 30, 'Fourty': 40, 'Fifty': 50}

You might also like