Python Handout
Python Handout
Introduction to Python:
It is a programming language which is used to give instruction to machines.
Python language is used in many placed due to its vocabulary (keywords/readymade
solutions/libraries) which can be used in any domain for that matter.
Comparison:
Data in Python:
Data are different types of variables in which the data are stored and for future reference
and coding. Below are few data types used in Python language.
String:
String is denoted as str. It is a data type in which we can store Text data within
single/double/triple quotes.
Integer:
Integer is denoted as int. It is a data type in which whole numbers can be stored without
any single/double/triple quotes.
Float:
Integer is denoted as float. It is a data type in which decimal numbers can be stored
without any single/double/triple quotes
Boolean:
Integer is denoted as bool. It is a data type in which either True/Fales results can be
stored without any single/double/triple quotes
Data structures is an efficient way of storing and organising data in such a way so that we as
developer can easily access and manage the data.
List:
Integer is denoted as list.
A list is represented by []
A list can contain values of any data type
A list allows manipulation (add/delete/or make any kind of changes)
Indexing is supported in list
Tuple:
Integer is denoted as tuple.
A tuple is represented by ()
A tuple can contain values of any data type
A tuple is a read only data structure, which means it is non-manipulative (cannot
add/delete/or make any kind of changes)
Indexing is supported in tuple
Set:
Integer is denoted as set.
A set is represented by {}
A set is known for sorting unique/distinct values only, in other words set do not
allow duplicates
Set is unordered in nature; hence indexing is not supported in Set.
Set can be used to implement mathematical sets.
Dictionaries:
Integer is denoted as dict.
It is a special data structure
It follows Key-Value format {key:value, key:value}
A Key is always immutable type, i.e. (int/float/str/bool/tuple). Using list as key will
result in error
Value can be of any data type
A dict is also represented using {K:V}
1. If-Elif-Else:
This is a conditional statement which can be used as dissension making while coding.
2.
3.
Numpy
It is that part of Python which is used for Data science
Agenda:
Introduction:
It is an extension to Python. It is very powerful and basic libraries for mathematical work
which will allow be used for scientific/engineering/ mathematical approach.
ND Array:
Matrix Manipulation
Misc excises: