0% found this document useful (0 votes)
143 views47 pages

Computer Programing INT1021.2 FINAL 2

The document provides an introduction to a Python course, discussing why Python is being taught, course structure and content, and resources for students. The course will cover Python fundamentals like variables, conditionals, functions, strings, lists, tuples and dictionaries.
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)
143 views47 pages

Computer Programing INT1021.2 FINAL 2

The document provides an introduction to a Python course, discussing why Python is being taught, course structure and content, and resources for students. The course will cover Python fundamentals like variables, conditionals, functions, strings, lists, tuples and dictionaries.
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/ 47

INT102 - Python

Lecture #0

Kick Start…
© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta
Engineers in the room!!!

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Paradigmatic shift

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Paradigmatic shift

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Paradigmatic shift

Computation

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


This course
… Will prepare you to build FUTURE

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Assessment Rubrics
• L- T- P : 0-0-4 [1+3]
• Marks Weightage:
–Attendance: 05
–Continuous Assessment* (CA): 25
–Mid Term Exam (MTE): 20
–End Term Exam (ETE) : 50

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Augmentation
• MEC201 – Solid Mechanics
• CIV207 – Strength of Materials

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


This course

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Brain-Teaser: 0.1

Q. Your programming readiness check:


A. Python
B. Programing language other than Python
C. No experience of programing till now

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why a Programming Language..?

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Thoughts

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Actions

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Action & Expression

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Action & Expression

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Action & Expression

Means = Language

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Language
• Natural
– People speak and converse in
– Evolved naturally

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Language
• Natural
– People speak and converse in
– Evolved naturally
• Formal
– Designed by people for specific purpose
– 3 + 29
– H2O

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Language – Beyond expression
• Talking to a computer system
• Getting legible results
• Representing results
• Actions

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Language – Beyond expression
• Programing language is formal language
devised to express computation

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Which Language ..?
• Programing language is formal language
devised to express computation
• Alphabets a computer can understand:
0 and 1
• Your laptop:
– 32-bit or 64-bit..?
• Your smartphone:
– 32-bit or 64-bit..?

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Which Language ..?
• Lower Level v/s Higher Level:

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Higher Level Language ..?
• Lower Level v/s Higher Level:

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Higher Level Language ..?

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Programming languages

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?
• Simple
• Simple and minimalistic due to Pseudo-code nature
• Easy to learn
• Structure and syntax are pretty intuitive and easy to grasp
• Free and Open source
• Downloading and installing Python is free and easy
• Source code is easily accessible
• Easy to use as Interpreted
• Rapid turnaround: no intermediate compile and link steps as in C or
C++
• Python programs are compiled automatically to an intermediate form
called bytecode, which the interpreter then reads
• This gives Python the development speed of an interpreter without the
performance loss inherent in purely interpreted languages

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?
• Object-oriented
• Structure supports such concepts as polymorphism, operation
overloading, and multiple inheritance
• Portable
• Python runs virtually every major platform used today
• As long as you have a compatible Python interpreter installed
• Extensible & Mixable
• Python can be linked to components written in other languages easily
• Linking to fast, compiled code is useful to computationally
intensive problems
• Python is good for code steering and for merging multiple
programs in otherwise conflicting languages
• Python/C integration is quite common

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?
• Embeddable
• Python can be embedded within C/C++ to give scripting capabilities
• Powerful
• Dynamic typing
• Built-in types and tools
• Library utilities
• Third party utilities (e.g. Numeric, NumPy, SciPy)
• Automatic memory management

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?
… Both Simple and Powerful simultaneously..!

… Right combination of both Features and


Performance..!

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python as an Engineer..?
• Embedded Applications
• Building embedded C software applications with Python is easy as it is
a programming language that is based on the C language.
• Raspberry Pi is a well-known embedded application that uses Python
for performing elaborate high-level computations.
• In general, Computing high-level applications on smaller devices is
relatively easy with Python
• AI/ML Libraries for Robotics
• Reinforcement Learning - OpenAI
• ML – Scikit-learn
• DL - Tensorflow
• Image Processing - OpenCV
• ROS (Robotic Operating System)
• Fastest and easiest way to learn ROS is by using Python, though ROS
can be programmed both in C and Python
© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta
Other Applications of Python
• Web development
• Game development
• Data science, Artificial intelligence and machine learning
• Desktop GUI
• Web scraping applications
• Building enterprise-level applications
• Image processing and graphic designing applications
• CAD applications
• Audio and video applications

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Why Python?

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Resources to watch out
https://www.python.org
Documentation, tutorials, beginners guide.
https://stackoverflow.com/
Dredging answers to all your code queries
http://wiki.python.org/main/PythonBooks
Finding the best books for Python
https://www.codecademy.com
The best beginners tutorial
https://www.python.org/downloads/
Download Python
https://www.continuum.io/downloads
Anaconda platform download
© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta
Resources to watch out
https://www.python.org
Documentation, tutorials, beginners guide.
https://stackoverflow.com/
Dredging answers to all your code queries
http://wiki.python.org/main/PythonBooks
Finding the best books for Python
https://www.codecademy.com
The best beginners tutorial
https://www.python.org/downloads/
Download Python
https://www.continuum.io/downloads
Anaconda platform download
© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta
Course Pedagogy
• Let us learn TOGETHER
• Participate
• Code on your own - Truthfulness
• Classroom → Assignments, Video
watch HOMEWORK → Classroom →
• Minor, Major Projects - Credited
• SUPER 5
• Create problem statements & build
solutions
© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta
Google Colaboratory
• All the coding tasks in the course
would be done on your uniquely
created Google Colab

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #1
– Introduction : python programming language, introduction to program and
debugging, formal and natural language
– Variables, Expression, and Statements : Values, variables, Variables name
and keywords, statements, operators and operand, order of operations,
operations on string, composition and comments
– Conditionals and Iteration : modulus operator, boolean expressions, logic
operators, conditional, alternative execution, nested conditionals and
return statements, while statements, encapsulation and generalization

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #2
– Functions and recursion : function calls, type conversion and coercion,
math functions, adding new function, parameters and argument, recursion
and its use
– String and Regular Expressions : string a compound data type, length,
string traversal, string slices, comparison, find function, looping and
counting

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #3
– Lists : list values, length, membership, operations, slices, deletion, accessing
elements, list and for loops, list parameters and nested list
– Tuples and Dictionaries : mutability and tuples, tuple assignment, tuple as
return values, random numbers and list of random numbers, counting and
many buckets, dictionaries operations and methods, sparse matrices,
aliasing and coping

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #4
– Creating and Manipulating Numerical Data: Arrays, Creating Arrays, Basic
Data Types, Indexing and Slicing, Copies and Views, Numerical Operations
on Array

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #5
• Data Exploration and Analysis :
• Understanding Series Objects, Creating a Series,
Accessing Data from a Series, Exploring and
Analyzing a Series, Operations on a Series,
• Understanding Data Frame Objects, Creating a
Data Frame from List, Dictionary and series,
Creating a Data Frame from Excel Spreadsheets
and CSV files, Dealing With Null Values and
Missing Values in Datasets, Updating and
Accessing a Data Frame, Exploring and Analyzing
a Data Frame, Statistical Data Analysis

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Course anatomy
• Unit #6
– Data Visualization :
Drawing a Basic plot, Drawing multiple lines and
plots, Subplot Function, Drawing Bar Graph,
Drawing Pie Chart, Drawing Histogram, Drawing
Box and Scatter Plot, Sine wave Plot , Plotting
Graph from File using Pandas.

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Quick review
• Is the pace of delivery comfortable?
• Yes
• No

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Quick review
• Is the language of delivery comfortable?
• Yes
• No

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Tasks@HOME
• Download and install Python*
• Download and install Python through
Anaconda*
• Create Google colab account
• Download your syllabus and IP
• Download a free book: ‘A Byte of Python’
• Video Watch: INT102-1 and INT102-2
• Create GitHub A/c

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta


Tomorrow
Action!!! Python snakes IN…

© LPU :: INT102 - Python:: Dr. Lovi Raj Gupta

You might also like