Class004 - Data Structures
Class004 - Data Structures
Module Basic
Resources Teacher:
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To note any
development from session)
Student Resources
1. Laptop along with audio and video
exchange
2. Notebook and Pen(To keep note of
important parts in the session)
Duration 50 Mins
1
Step Say Perform
2
● To connect two string variables we can
use +
operator, this is known as
concatenation.
new_list=[34,a_list,”old”]
3
The first element of a list has index 0 and the Refer to indexing
second element has index 1 and so on. in String
4
at=(22,”n”, 7.89, “now”, False)
Some functions, that can be used on both list Remind that len
and tuple are: function gives the
● len(): it gives the no. of elements in it. length of string
Syntax: len(list) or len(tuple) too.
● .count(): i t gives the count of an element
in a list of tuple
Syntax: list.count(element)
● In case the student is comfortable with Strings, List and Tuples at this point
but class time remaining is less than 10 mins, just introduce the concepts of
Set and Dictionary.
● For students struggling to understand Strings, Lists and Tuples, teachers can
skip Set and Dictionary.
● If the student is able to cope up and time permits do cover both concepts
and functions.
● Ask the student to stop sharing screen and you share the screen
5
again.
a_dict={1: ”a”,2:”b”,3:”c”}
Here, 1,2,3 are the keys and a,b,c are its values
respectively.
Functions To access any element, k eys can be directly used Explain the use of
as index both.
Syntax: dictionary[key] or we can use the . get()
function.
Syntax: dictionary.get(key)
6
student has covered both concept and functions
Functions Help the student solve all the questions. Student Activity 3:
In case the student solves all the questions too Sets and
quickly, add in more questions to test use of all the Dictionary
functions learned till now.
Resources: