PYTHON
PROGRAMMIN
G
SUBMITTED TO: MR. HARJEET SINGH AND MRS. KIRANDEEP KAUR
SUBMITTED BY: MANTEJ SINGH ARORA(200529505688)
DEPARTEMENT OF COMPUTER SCIENCE AND ENGINEERING
SESSION 2022-23
INDEX
•Python •Projects
INTRODUCTION TO PYTHON
• Python is a computer programming language.
• It is used to make mobile application, games and websites, and software,
automate tasks, and conduct data analysis.
• Python is a general-purpose language..
• Guido van Rossum introduced the python language in 1989.
DATATYPES IN PYTHON
• •Numeric-(Integer and Float)
• •Dictionary
• •Boolean
• • Set
• •Sequence-(Strings, Tuple and List)
OPERATORS
• Arithmetic Operators
• Comparison (Relational) Operators
• Assignment Operators
• Logical Operators
• Bitwise Operators
• Membership Operators
• Identity Operators
FLOW CONTROL STATEMENTS
• Python’s flow control statements are ‘while’, ‘for’ and ‘if’.
• For a switch, you need to use ‘if’. For enumerating through list members,
use ‘for’. For obtaining a number list, use range (number)
DECISION MAKING STATEMENTS
• if statement
• Else statements
• Nested if Statements
• Elif statements
FUNCTIONS
• Functions The ‘def’ keyword is used to declare functions.
• Optional arguments can be set in the function declaration after mandatory arguments by assigning
them default values.
• In the case of named arguments, the argument name is assigned a value.
• Functions can return a tuple, and you can effectively return several values using tuple unpacking.
• Calling a Function:-
• Defining a function only gives it a name, specifies the parameters that are to be included in the
function and structures the blocks of code
CLASSES / OBJECT
• A class is a made up of group of objects.
• Classes provide a means of bundling data and functionality together.
• An object is simply a collection of data (variables) and methods (functions) that act on those
data.
• Similarly, a class is a blueprint for that object.
• We can think of a class as a sketch (prototype) of a house. It contains all the details about the
floors, doors, windows, etc
INHERITANCE
• Inheritance is an important aspect of the object-oriented programming.
• Inheritance provides code reusability of the program.
• We can use an existing class to create a new class instead of creating it from scratch.
• In inheritance, the child class acquires the properties and can access all the data members and functions defined in the
parent class.
• There are some types of inheritance:
• Single inheritance
• Multi-Level inheritance
• Multiple inheritance
• Hybrid Inheritance
LOOPING STATEMENTS IN PYTHON
• For loop
• While loop
• Nested For loop
LIBRARY
• NumPy
• Matplotlib
• Pandas
• Seaborn
• SciPy
• Scikit learn
• Pygame
TYPES OF LEARNER
• Lazy Learner
• Eager Learner
PROJECTS
• Minor Projects
• TIC TAC TOE Game
• Word Game
• Digits Game
• Quiz Brain
• Major projects
• Pygame
• Snake Game
• Pong Game