Let us understand Tuples in Python. We had learnt Lists in Python in the previous article. Tuples can be understood in comparison to the Lists.
We created Lists. Lists were a set of objects enclosed in [ ] square braces. Tuples are also a set of objects but they are enclosed in ( ) brackets.
Thursday
Tuesday
Learn Python Easy way - Dictionaries
Let us see what is a dictionary in Python. Creating a dictionary is like creating a List, a list of coupled objects, pair of objects. A list is an ordered set of objects, and a dictionary is un-ordered set of objects
Objects in a list can be accessed by their index numbers but objects in a dictionary can't. Each object in a dictionary has a Key and a Value. We need to use the key to access it's value. A key woks like the index number. But a key is not necessarily a number. It can be any data type.
Objects in a list can be accessed by their index numbers but objects in a dictionary can't. Each object in a dictionary has a Key and a Value. We need to use the key to access it's value. A key woks like the index number. But a key is not necessarily a number. It can be any data type.
Wednesday
Learn Python Easy Way Part 6 Copy Lists
Today lets is see how to copy a list. That means we can copy an entire list or a part of it as a separate list. But it has interesting features to it.
Let us create a list of names of cities
Cities = ['Mumbai', 'Pune', 'Nagpur']
Let us create a list of names of cities
Cities = ['Mumbai', 'Pune', 'Nagpur']
Learn Python Easy way Part 5 Lists
Let us look learn some more ways to work with Python lists.
There one more way to display the element present in a list at a certain location, using the pop method
cities = ["Mumbai", "Pune", "Bangalore", "Calcutta"]
cities.pop(0)
'Mumbai'
There one more way to display the element present in a list at a certain location, using the pop method
cities = ["Mumbai", "Pune", "Bangalore", "Calcutta"]
cities.pop(0)
'Mumbai'
Monday
Learn Python Easy Way Part 4 (Lists)
Let us continue from where we left in the last article. We will see some more ways to work with lists in Python
Finding numbers of items in a list
mylist = ['Dehli', 'Washington', 'Tokyo']
len(mylist)
3
Finding numbers of items in a list
mylist = ['Dehli', 'Washington', 'Tokyo']
len(mylist)
3
Wednesday
Learn Python Easy Way - Part 3
We will look at the sequential data types in Python. They are Strings, Lists and Tuples. You can access a single character in a string by its index.
For Example
Saying = "A Friend in need in a Friend indeed"
print(Saying[0], Saying[3], Saying[4],Saying[7])
A r i d
For Example
Saying = "A Friend in need in a Friend indeed"
print(Saying[0], Saying[3], Saying[4],Saying[7])
A r i d
Subscribe to:
Posts (Atom)
Featured Post
Creating Games in Scratch for ICSE Class 6
An Introduction to Creating Games in Scratch for ICSE Class 6 Hello friends, I hope you have already read the previous post on An Int...
-
In this hour of code exercise "Code with Anna and Elsa" you will learn to draw different geomoetric shapes on ice. There are a ...
-
ICSE Class 5 Computer Studies This lesson will give students a brief introduction to Scratch programming. I am using Scratch3...
-
This blog post is created to support the students taking up the Code Studio courses on Code.org. I have tried to create an answer sheet for ...