SlideShare a Scribd company logo
GOVERNMENT ENGINEERING COLLEGE
BHARATPUR
INDUSTRIAL TRAINING
2020-21
SUBMITTED BY:
MONISHA GOYAL
18EELCS010
SUBMITTED TO:
ANKIT SIR
 Python is a general purpose programming language that is often applied in
scripting roles.
 Python is also called as Interpreted language
 Python supports multiple programming paradigms including imperative, procedural
, functional and object oriented programming style.
 Python can be used for • System programming • Graphical User Interface
Programming • Internet Scripting • Component Integration • Database
Programming • Gaming, Images, XML , Robot and more .
 Python interpreters are available for installation on many operating systems,
allowing Python code execution on a wide variety of systems. Eg- IDLE
INTRODUCTION
KEYWORDS IN PYTHON
KEYWORDS
CLASS
PRIVATE VARIABLE
STRONGLY PRIVATE VARIABLE
SPECIAL PURPOSE
if, while
Complex, Exception
_aadharnum, _accountnum
__mobilenum, __loginid
__add__, __init__
Higher level programming languages like python provides a predefined
set of keywords using which a program is coded.
• Numeric Any representation of data which has numeric value.
Python identifies three types:-
1. INTEGER Positive and negative whole numbers. Examples: 1234, -2 etc.
2. FLOAT Real numbers with a floating point representation Examples: -
55.550
3.COMPLEX NUMBERS A number with a real and imaginary component is
represented as a + bj in Python where a and b are floats and
j = √-1. Examples: 4+6j.
DATATYPES IN PYTHON
• BOOLEAN: Any representation of data which has two values
denoted by True and False.
• SEQUENCE: An ordered collection of similar or different data
types. The built-in Sequence data types in python are:
1. STRING: A collection of one or more characters put in single,
double or triple quotes. Examples: ‘Hello’, "Hello",
"'Hello'", """Hello""“.
2. LIST: An ordered collection of one or more data items, not
necessarily of same type, put in square brackets. Examples:
[1,"Ravi",75.50, True].
3. TUPLE: Similar to list but he contents of a tuple cannot be modified – it is
immutable - after the tuple is created. Examples: (1,"Ravi", 75.50, True).
• DICTIONARY An unordered collection of data in key:value pair
form. Collection of such pairs is enclosed in curly brackets.
Example:
{1:"Superman", 2:"Wonder Woman", 3:"Thor", 4: "Hulk", 5:"Black
Widow“}
PROGRAMMING IN PYTHON
INTERACTIVE MODE:-Invoking the interpreter without passing a
script file as a parameter brings up the following prompt −
type the following text at the Python prompt and press the Enter −
this produces the following result −
Interactive mode is not suitable for automated processes. So we use scripting mode.
SCRIPTING MODE: Instead of executing one statement at a time we write all the
statement in a text file with .py extension. This script is commonly known as a python
program which can be executed through command line or from run menu of IDLE.
Advantages:
• Easily insert update and delete statements.
• Code or functions from a script can be inserted.
• Automate and schedule.
MATH OPERATOR IN PYTHON
>>> print 3 + 12
15
>>> print 12 – 3
9
>>> print 9 + 5 – 15 + 12
11
Operators: add: +
subtract: -
Math Rule: If you want Python to answer in floats, you have to talk to it in floats.
More operators: divide: /
multiply: *
>>> print 3 * 12
36
>>> print 12.0 / 3.0
4.0
STRINGS IN PYTHON
Strings operators:
 Concatenation: + Adds values on either side of the operator
Try concatenating:
: >>> print “Hello” + “ “ + “world!”
Hello world
 Multiplying: * Creates new strings, concatenating multiple copies of the
same string
Try multiplying
>>> print “HAHA” * 250
MODULE IN PYTHON:
 A module allows you to logically organize your Python code. Grouping related code
into a module makes the code easier to understand and use. A module is a Python
object with arbitrarily named attributes that you can bind and reference.
 Simply, a module is a file consisting of Python code. A module can define
functions, classes and variables. A module can also include runnable code.
The Import Statement:
When the interpreter encounters an import statement, it imports the module if the
module is present in the search path.
When the above code is executed, it produces the following result −
OBJECT ORIENTED PROGRAMMING:
 Python is a multi-paradigm programming language. It supports different
programming approaches.
 One of the popular approaches to solve a programming problem is by
creating objects. This is known as Object-Oriented Programming
(OOP).
 An object has two characteristics:
• attributes
• Behavior
Let's take an example:A parrot is can be an object,as it has the
following properties:
• name, age, color as attributes
• singing, dancing as behavior
 The concept of OOP in Python focuses on creating reusable code.
CONNECTING TO SQLITE DATABASE
 MySQLdb is an interface for connecting to a MySQL database server from Python
 After creating a database in mysql, we need to connect it to the python code.we
follow the following steps for connectivity to the database:
STUDENT MANAGEMENT SYSYTEM USING
PYTHON

More Related Content

What's hot

Python final ppt
Python final pptPython final ppt
Python final ppt
Ripal Ranpara
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
R.h. Himel
 
Python
PythonPython
Python
GAnkitgupta
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Syed Zaid Irshad
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
KrishnaMildain
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Ayshwarya Baburam
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python ppt
Priyanka Pradhan
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
AnirudhaGaikwad4
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
Shivam Gupta
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Agung Wahyudi
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
Dr.YNM
 
Python programming
Python  programmingPython  programming
Python programming
Ashwin Kumar Ramasamy
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
Collaboration Technologies
 

What's hot (20)

Python final ppt
Python final pptPython final ppt
Python final ppt
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
 
Python
PythonPython
Python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python ppt
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Python programming
Python  programmingPython  programming
Python programming
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 

Similar to Programming

Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
Excellence Academy
 
Python intro
Python introPython intro
Python intro
Piyush rai
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
Excellence Academy
 
Report om 3
Report om 3Report om 3
Report om 3
HarryRoy9
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programmingChetan Giridhar
 
Python programming
Python programmingPython programming
Python programming
Prof. Dr. K. Adisesha
 
Python for katana
Python for katanaPython for katana
Python for katana
kedar nath
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
shetoooelshitany74
 
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Godwin585235
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
JosephMuez2
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Mohammed Rafi
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
natnaelmamuye
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
RohitKumar639388
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
Andrew McNicol
 

Similar to Programming (20)

Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Python intro
Python introPython intro
Python intro
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Report om 3
Report om 3Report om 3
Report om 3
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programming
 
Python programming
Python programmingPython programming
Python programming
 
Python for katana
Python for katanaPython for katana
Python for katana
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
 
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
INTERNSHIP REPORT.docx
 INTERNSHIP REPORT.docx INTERNSHIP REPORT.docx
INTERNSHIP REPORT.docx
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
 

Recently uploaded

power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 

Recently uploaded (20)

power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 

Programming

  • 1. GOVERNMENT ENGINEERING COLLEGE BHARATPUR INDUSTRIAL TRAINING 2020-21 SUBMITTED BY: MONISHA GOYAL 18EELCS010 SUBMITTED TO: ANKIT SIR
  • 2.
  • 3.  Python is a general purpose programming language that is often applied in scripting roles.  Python is also called as Interpreted language  Python supports multiple programming paradigms including imperative, procedural , functional and object oriented programming style.  Python can be used for • System programming • Graphical User Interface Programming • Internet Scripting • Component Integration • Database Programming • Gaming, Images, XML , Robot and more .  Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Eg- IDLE INTRODUCTION
  • 4. KEYWORDS IN PYTHON KEYWORDS CLASS PRIVATE VARIABLE STRONGLY PRIVATE VARIABLE SPECIAL PURPOSE if, while Complex, Exception _aadharnum, _accountnum __mobilenum, __loginid __add__, __init__ Higher level programming languages like python provides a predefined set of keywords using which a program is coded.
  • 5.
  • 6. • Numeric Any representation of data which has numeric value. Python identifies three types:- 1. INTEGER Positive and negative whole numbers. Examples: 1234, -2 etc. 2. FLOAT Real numbers with a floating point representation Examples: - 55.550 3.COMPLEX NUMBERS A number with a real and imaginary component is represented as a + bj in Python where a and b are floats and j = √-1. Examples: 4+6j. DATATYPES IN PYTHON
  • 7. • BOOLEAN: Any representation of data which has two values denoted by True and False. • SEQUENCE: An ordered collection of similar or different data types. The built-in Sequence data types in python are: 1. STRING: A collection of one or more characters put in single, double or triple quotes. Examples: ‘Hello’, "Hello", "'Hello'", """Hello""“. 2. LIST: An ordered collection of one or more data items, not necessarily of same type, put in square brackets. Examples: [1,"Ravi",75.50, True]. 3. TUPLE: Similar to list but he contents of a tuple cannot be modified – it is immutable - after the tuple is created. Examples: (1,"Ravi", 75.50, True).
  • 8. • DICTIONARY An unordered collection of data in key:value pair form. Collection of such pairs is enclosed in curly brackets. Example: {1:"Superman", 2:"Wonder Woman", 3:"Thor", 4: "Hulk", 5:"Black Widow“}
  • 9.
  • 10. PROGRAMMING IN PYTHON INTERACTIVE MODE:-Invoking the interpreter without passing a script file as a parameter brings up the following prompt − type the following text at the Python prompt and press the Enter − this produces the following result − Interactive mode is not suitable for automated processes. So we use scripting mode.
  • 11. SCRIPTING MODE: Instead of executing one statement at a time we write all the statement in a text file with .py extension. This script is commonly known as a python program which can be executed through command line or from run menu of IDLE. Advantages: • Easily insert update and delete statements. • Code or functions from a script can be inserted. • Automate and schedule.
  • 12. MATH OPERATOR IN PYTHON >>> print 3 + 12 15 >>> print 12 – 3 9 >>> print 9 + 5 – 15 + 12 11 Operators: add: + subtract: - Math Rule: If you want Python to answer in floats, you have to talk to it in floats. More operators: divide: / multiply: * >>> print 3 * 12 36 >>> print 12.0 / 3.0 4.0
  • 13. STRINGS IN PYTHON Strings operators:  Concatenation: + Adds values on either side of the operator Try concatenating: : >>> print “Hello” + “ “ + “world!” Hello world  Multiplying: * Creates new strings, concatenating multiple copies of the same string Try multiplying >>> print “HAHA” * 250
  • 14. MODULE IN PYTHON:  A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module is a Python object with arbitrarily named attributes that you can bind and reference.  Simply, a module is a file consisting of Python code. A module can define functions, classes and variables. A module can also include runnable code. The Import Statement: When the interpreter encounters an import statement, it imports the module if the module is present in the search path. When the above code is executed, it produces the following result −
  • 15. OBJECT ORIENTED PROGRAMMING:  Python is a multi-paradigm programming language. It supports different programming approaches.  One of the popular approaches to solve a programming problem is by creating objects. This is known as Object-Oriented Programming (OOP).  An object has two characteristics: • attributes • Behavior Let's take an example:A parrot is can be an object,as it has the following properties: • name, age, color as attributes • singing, dancing as behavior  The concept of OOP in Python focuses on creating reusable code.
  • 16. CONNECTING TO SQLITE DATABASE  MySQLdb is an interface for connecting to a MySQL database server from Python  After creating a database in mysql, we need to connect it to the python code.we follow the following steps for connectivity to the database: