SlideShare a Scribd company logo
What is Python ?
It is powerful, general-purpose,
high level, object oriented
programming language.
It is developed by Guido van
Rossum .
It is released in 1991.
Features of Python ?
Platform Independent(Window os,Linux
os etc.)
Object Oriented
Flexible
Structure Oriented
Portable
Simple
Application of Python ?
Web Application
Software development
Database GUI Application
Scientific and Numeric Computing
Business Applications
Console Based Application
Why Use Python ?
It is very simple and easy to learn.
It powerful,fast and secure.
It has very simple syntax.
It is powerful scripting language.
It can be run on different kind of
platform for example
Window,Mac,Linux etc.
What is Python.pdf
What is Python.pdf
What is Python.pdf
What is Python.pdf
Variable in Python
• It is a name of storage space which is used to
store data.
• It's value may be changed.
• It always contains last value stored to it.
• There is no need to declare a variable in
python.
• Variable is created by assigning a value to it.
Variable
There are two types
• Local Variable
• Global Variable
Variable Initialization
• name="Tom"
• rollno=205
• marks=85.6
creating variables
• name="Tom"
• rollno=205
• marks=85.6
printing value of variables
• print("Name:",name)
• print("Roll:",rollno)
• print("Marks:",marks)
• **Output**
• Name: Tom
• Roll: 205
• Marks: 85.6
Assigning single value to multiple variable
creating variables
• a=b=c=90
• #printing value of varibales
• print("a:",a)
• print("b:",b)
• print("c:",c)
• **Output**
• a: 90
• b: 90
• c: 90
Assigning multiple values to multiple variables
creating variables
• a,b,c=70,80,90
• #printing value of varibales
• print("a:",a)
• print("b:",b)
• print("c:",c)
• **Output**
• a: 70
• b: 80
• c: 90
Rules to define a variable
• The first letter of a variable should be alphabet or
underscore(_).
• The first letter of variable should not be digit.
• After first character it may be combination of
alphabets and digits.
• Blank spaces are not allowed in variable name.
• Variable name should not be a keyword.
• Variable names are case sensitive for example
marks and MARKS are different variables.
Local Variable
• A variable declared inside the body of the
function is called local variable.
• Local variable can be used only inside that
function in which it is defined.
Local Variable
• #function definition
• def add():
• #creating variable
• x=50
• y=30
• z=x+y
• print("Add=",z)
• #Calling funtion
• add()
**Output**
• Add= 80
Global Variable
• A variable which is created outside a function
is called global variable.
• It can be used anywhere in the program.
#creating global variable
• x=50
• y=30
• def add():
• #accessing global variable
• #inside a function
• print("Inside function Sum=",x+y)
• #Calling funtion
• add()
• #accessing global variable
• #outside a function
• print("Outside function Sum=",x+y)
• """
• **Output**
• Inside function Sum= 80
• Outside function Sum= 80
User input in Python
• 1.input() is a predefined function which is used
to take user input in Python.
• 2.Default user input is of type string.
User input of String Value
• name=input("Enter your name:")
• print("Your name:",name)
• **Output**
• Enter your name:Aayushi
• Your name: Aayushi
User input of String Value
• #Printing of data type of name
• print(type(name))
• output
• <class 'str'="">
• </class>
User input of Integer Value
• int() is a predefined function which is used to
convert string into integer.
int
method 1
• number=input("Enter any number:")
Output:
• Enter any number:204
int
method 2
number=int(input("Enter any number:"))
print("Given Number:",number)
Output:
Enter any number:204
Given Number: 204
User input of Float Value
• float() is a predefined function which is used
to convert string into float.
• program
marks=float(input("Enter your marks:"))
print("Your Marks is:",marks)
Output:
• Enter your marks:84.2
• Your Marks is: 84.2
Data Types in Python
• It is a type of data which is used in the
program.
• There is no need of data type to declare a
variable in Python.
• type() is predefined function of Python
which is used to get data type of any data.
Type of Data Type
• Python contains following data types:
• Numbers
• String
• List
• Tuple
• Dictionary

More Related Content

PDF
What is Shift Left Testing.pdf
PDF
Introduction to flutter
PDF
Customizing Theme and Style for Material Design : Droid Kaigi 2016
PPTX
All You Need to Know About Java – Advantages and Disadvantages
PDF
Python Spyder IDE | Edureka
PPT
Introduction to the Web API
PPTX
Best Python Online Training with Live Project by Expert
PPTX
게임 기획서 작성하기 - 송철헌
What is Shift Left Testing.pdf
Introduction to flutter
Customizing Theme and Style for Material Design : Droid Kaigi 2016
All You Need to Know About Java – Advantages and Disadvantages
Python Spyder IDE | Edureka
Introduction to the Web API
Best Python Online Training with Live Project by Expert
게임 기획서 작성하기 - 송철헌

Similar to What is Python.pdf (20)

PPTX
PPTX
BASICS OF PYTHON usefull for the student who would like to learn on their own
PPTX
Lecture1_introduction to python.pptx
PPTX
Python_Functions_Unit1.pptx
PPTX
CH.4FUNCTIONS IN C (1).pptx
PPTX
Introduction to C++
PPTX
Programming using c++ tool
PDF
EC2311-Data Structures and C Programming
PDF
Chapter 0 Python Overview (Python Programming Lecture)
PPTX
Unit No 2.pptx Basic s of C Programming
PPTX
Python Basics by Akanksha Bali
PPTX
Python-Beginer-PartOnePython is one of the top programming languages in the w...
PPTX
Function (rule in programming)
PPTX
Unit2 input output
PPTX
What is Data Types and Functions?
PDF
web programming UNIT VIII python by Bhavsingh Maloth
PPTX
C++ Functions.pptx
PPTX
CLASS-11 & 12 ICT PPT PYTHON PROGRAMMING.pptx
PPTX
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
PPTX
Python basics
BASICS OF PYTHON usefull for the student who would like to learn on their own
Lecture1_introduction to python.pptx
Python_Functions_Unit1.pptx
CH.4FUNCTIONS IN C (1).pptx
Introduction to C++
Programming using c++ tool
EC2311-Data Structures and C Programming
Chapter 0 Python Overview (Python Programming Lecture)
Unit No 2.pptx Basic s of C Programming
Python Basics by Akanksha Bali
Python-Beginer-PartOnePython is one of the top programming languages in the w...
Function (rule in programming)
Unit2 input output
What is Data Types and Functions?
web programming UNIT VIII python by Bhavsingh Maloth
C++ Functions.pptx
CLASS-11 & 12 ICT PPT PYTHON PROGRAMMING.pptx
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
Python basics
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Presentation on HIE in infants and its manifestations
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Cell Structure & Organelles in detailed.
PPTX
Cell Types and Its function , kingdom of life
PDF
Classroom Observation Tools for Teachers
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
Final Presentation General Medicine 03-08-2024.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Abdominal Access Techniques with Prof. Dr. R K Mishra
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Presentation on HIE in infants and its manifestations
O5-L3 Freight Transport Ops (International) V1.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Microbial disease of the cardiovascular and lymphatic systems
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Cell Structure & Organelles in detailed.
Cell Types and Its function , kingdom of life
Classroom Observation Tools for Teachers
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Final Presentation General Medicine 03-08-2024.pptx
Ad

What is Python.pdf

  • 1. What is Python ? It is powerful, general-purpose, high level, object oriented programming language. It is developed by Guido van Rossum . It is released in 1991.
  • 2. Features of Python ? Platform Independent(Window os,Linux os etc.) Object Oriented Flexible Structure Oriented Portable Simple
  • 3. Application of Python ? Web Application Software development Database GUI Application Scientific and Numeric Computing Business Applications Console Based Application
  • 4. Why Use Python ? It is very simple and easy to learn. It powerful,fast and secure. It has very simple syntax. It is powerful scripting language. It can be run on different kind of platform for example Window,Mac,Linux etc.
  • 9. Variable in Python • It is a name of storage space which is used to store data. • It's value may be changed. • It always contains last value stored to it. • There is no need to declare a variable in python. • Variable is created by assigning a value to it.
  • 10. Variable There are two types • Local Variable • Global Variable
  • 11. Variable Initialization • name="Tom" • rollno=205 • marks=85.6
  • 12. creating variables • name="Tom" • rollno=205 • marks=85.6
  • 13. printing value of variables • print("Name:",name) • print("Roll:",rollno) • print("Marks:",marks) • **Output** • Name: Tom • Roll: 205 • Marks: 85.6
  • 14. Assigning single value to multiple variable creating variables • a=b=c=90 • #printing value of varibales • print("a:",a) • print("b:",b) • print("c:",c) • **Output** • a: 90 • b: 90 • c: 90
  • 15. Assigning multiple values to multiple variables creating variables • a,b,c=70,80,90 • #printing value of varibales • print("a:",a) • print("b:",b) • print("c:",c) • **Output** • a: 70 • b: 80 • c: 90
  • 16. Rules to define a variable • The first letter of a variable should be alphabet or underscore(_). • The first letter of variable should not be digit. • After first character it may be combination of alphabets and digits. • Blank spaces are not allowed in variable name. • Variable name should not be a keyword. • Variable names are case sensitive for example marks and MARKS are different variables.
  • 17. Local Variable • A variable declared inside the body of the function is called local variable. • Local variable can be used only inside that function in which it is defined.
  • 18. Local Variable • #function definition • def add(): • #creating variable • x=50 • y=30 • z=x+y • print("Add=",z) • #Calling funtion • add() **Output** • Add= 80
  • 19. Global Variable • A variable which is created outside a function is called global variable. • It can be used anywhere in the program. #creating global variable • x=50 • y=30
  • 20. • def add(): • #accessing global variable • #inside a function • print("Inside function Sum=",x+y) • #Calling funtion • add() • #accessing global variable • #outside a function • print("Outside function Sum=",x+y) • """ • **Output** • Inside function Sum= 80 • Outside function Sum= 80
  • 21. User input in Python • 1.input() is a predefined function which is used to take user input in Python. • 2.Default user input is of type string.
  • 22. User input of String Value • name=input("Enter your name:") • print("Your name:",name) • **Output** • Enter your name:Aayushi • Your name: Aayushi
  • 23. User input of String Value • #Printing of data type of name • print(type(name)) • output • <class 'str'=""> • </class>
  • 24. User input of Integer Value • int() is a predefined function which is used to convert string into integer.
  • 25. int method 1 • number=input("Enter any number:") Output: • Enter any number:204
  • 26. int method 2 number=int(input("Enter any number:")) print("Given Number:",number) Output: Enter any number:204 Given Number: 204
  • 27. User input of Float Value • float() is a predefined function which is used to convert string into float. • program marks=float(input("Enter your marks:")) print("Your Marks is:",marks) Output: • Enter your marks:84.2 • Your Marks is: 84.2
  • 28. Data Types in Python • It is a type of data which is used in the program. • There is no need of data type to declare a variable in Python. • type() is predefined function of Python which is used to get data type of any data.
  • 29. Type of Data Type • Python contains following data types: • Numbers • String • List • Tuple • Dictionary