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

Name: V.

RUTHVIK
Reg No: 2200032675
Sec No: 24
Course: PFSD
Week-6
Experiment Title: Working with Dictionary and Functions

Aim/Objective: To Work with Working with Dictionary and Functions parameters

Description: It identifies the dictionary creation, modification methods and parameter passing
mechanism using python in functions.

Pre-Requisites:

• Basics of python and PyCharm code editor.


• Basic knowledge about Functions and mapping datatype.

Pre-Lab:

a) Python script to concatenate following dictionaries to create a new one. Sample Dictionary:

dic1={1:10, 2:20}

dic2= {3:30, 4:40}

dic3= {5:50,6:60}

Expected Result: {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}


Program: -

Output: -
In-Lab:

a) Python script to merge two Python dictionaries

Program: -

Output: -

b) Python function that accepts a string and calculate the number of upper case letters
and lower case letters.
Sample String: 'The quick Brow Fox' Expected Output:
No. of Upper-case characters: 3 No. of Lower case Characters: 12

Program: -
Output: -

Post-Lab:

a) Program to remove an empty tuple(s) from a list of tuples. Sample data: [(), ('',), ('a', 'b'), ('a',
'b', 'c'), ('d')] Expected output: [('',), ('a', 'b'), ('a', 'b', 'c'), 'd'].

Program: -
Output:-

You might also like