0% found this document useful (0 votes)
3 views8 pages

Lab-3 DS

The document outlines an experiment focused on Python data types, including Lists, Sets, Dictionaries, and Tuples, detailing their characteristics and uses. It includes objectives, descriptions of each data type, and activities for practical coding exercises. Additionally, it features a laboratory skills assessment rubric for evaluating students' procedural and cognitive skills related to the experiment.

Uploaded by

Wahab Tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Lab-3 DS

The document outlines an experiment focused on Python data types, including Lists, Sets, Dictionaries, and Tuples, detailing their characteristics and uses. It includes objectives, descriptions of each data type, and activities for practical coding exercises. Additionally, it features a laboratory skills assessment rubric for evaluating students' procedural and cognitive skills related to the experiment.

Uploaded by

Wahab Tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Experiment no 3

Python Data Types (Lists, Sets, Dictionaries, Tuples)


OBJECTIVES:

• To learn different datatypes of python.


• To learn Lists, Sets, Dictionaries, Tuples and their uses for different problems.

1. LISTS:

Lists are used to store multiple items in a single variable.


Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple,
Set, and Dictionary, all with different qualities and usage.

Lists are created using square brackets:

Figure 1: Lists in Python

2. SETS:

Sets are used to store multiple items in a single variable.


A set is a collection which is unordered, unchangeable*, and unindexed.
Set items are unchangeable, but you can remove items and add new items.

Figure 2: Sets in Python

2.1 Duplicates Not Allowed


Sets cannot have two items with the same value.

Figure 3: Duplicates not allowed


3. DICTIONARIES

• Dictionaries are used to store data values in key:value pairs.


• A dictionary is a collection which is ordered*, changeable and do not allow duplicates.
• Dictionary items are ordered, changeable, and do not allow duplicates.
• Dictionary items are presented in key:value pairs, and can be referred to by using the key name.

Figure 4: Dictionaries in Python

4. TUPLE
• Tuples are used to store multiple items in a single variable.
• Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3
are List, Set, and Dictionary, all with different qualities and usage.
• A tuple is a collection which is ordered and unchangeable.
• Tuples are written with round brackets.

Figure 5: Tuples in Python

Figure 6: Looping through Tuples in Python


5. ACTIVITIES:

A1) Write a code for lists and also show how to add remove an item in list as well
as show the loop through list.
A2) Write a code for sets and also show how to add remove an item in list as well as show
the loop through list.
A3) Write a code for dictionaries and also show how to add remove an item in list as well
as show the loop through list.
A4) Write a code for tuple and also show how to add remove an item in list as well as
show the loop through list.
IMPORTANT: All the activities` code should be attached to the manual before summary section.
Lab Exercise and Summary
Summary should cover Introduction, Procedure, Data Analysis and Evaluation.

4
5
Student’s Signature: Date: _

6
LABORATORY SKILLS ASSESSMENT (Psychomotor)

Total Marks:100
Criteria Level 1 Level 2 Level 3 Level 4 Score
(Max Marks) 0% ≤ S < 50% 50% ≤ S< 70% 70% ≤ S< 90% 90%≤ S ≤100% (S)
Selects Selects and Selects and Selects and
inappropriate applies applies the applies
skills and/or appropriate skills appropriate appropriate
Procedural
strategies and/or strategies strategies and/or strategies and/or
Awareness
Required by required by the skills specific to skills specific to
(30)
the task. task with major the task without the task without
errors. significant errors. any error.

Makes major Makes numerous Makes some non- Applies the


critical errors in critical errors in critical errors in procedural
applying applying applying knowledge in
procedural procedural procedural optimized ways
Practical
knowledge knowledge knowledge related to
Implementation
related to python related to python related to python python Lists,
(30)
Lists, Sets, Lists, Sets, Lists, Sets, Sets,
Dictionaries, Dictionaries, Dictionaries, Dictionaries,
Tuples. Tuples. Tuples. Tuples.
Uses tools, Uses tools, Uses tools, Uses tools,
Use of
equipment and equipment and equipment and equipment and
Tool/Equipment materials with materials with materials with materials with a
(30) limited some considerable high degree of
competence. competence. competence. competence.
Requires constant Requires some Follows safety Routinely follows
reminders to reminders to procedures with safety procedures.
Safety follow safety follow safety only minimal
(10) procedures. procedures. reminders.

Marks Obtained

Instructor Name: Sign:

7
LABORATORY SKILLS ASSESSMENT (Affective)
Total Marks: 40

Criteria Level 1 Level 2 Level 3 Level 4


Score
(Max. Marks) 0% ≤ S < 50% 50% ≤ S < 70% 70% ≤ S < 90% 90% ≤ S ≤ 100%
Introduction Very little Introduction is Introduction is Introduction
(5) background brief with some nearly complete, complete and well-
information minor mistakes missing some written; provides
provided or minor points all necessary
information is background
incorrect principles for the
experiment
Procedure Many stages of Many stages of The procedure The procedure is
(5) the procedure the procedure are could be more well designed and
are not entered entered on the lab efficiently all stages of the
on the lab report. designed but most procedure are
report. stages of the entered on the lab
procedure are report.
entered on the lab
report.
Data Record Data is brief and Data provides Data is almost Data is complete
(10) missing some complete and
significant significant but has some relevant. Tables
pieces of information minor with
information. and has few mistakes. units are provided.
critical Graphs are
mistakes. labeled.
All questions are
answered
correctly.
Data Analysis Data is Data is presented Data is presented Data is presented
(10) presented in in in
in very unclear ways that are not ways that can be ways that best
manner. clear enough. understood and facilitate
interpreted. understanding and
interpretation.

Report Quality Report contains Report is Report is well Report is well


(10) many errors. somewhat organized and organized and
organized with cohesive but cohesive and
some spelling or contains some contains no
grammatical grammatical grammatical
errors. errors. errors.
Presentation seems
polished.

Marks Obtained
LABORATORY SKILLS ASSESSMENT (Cognitive)

Total Marks: 10
(If any)

Marks Obtained

Instructor’s Signature: Date: _

You might also like