Python Tutorial
Lecture - 1Lecture - 1
-Ravi Kiran Khareedi
Why Python ?
• Simple to use
• Powerful (Extensive Libraries)
• Free and Open Source ☺
• Portable (Windows, Mac, Linux..)• Portable (Windows, Mac, Linux..)
• And Many more…
Basics
• Literal Constants
– The value we use literally.
– There are values used to assign to variables
Types of LiteralsTypes of Literals
– Strings (Ex: ‘This is Python’ , “It’s good”)
– Number (Ex: 2 , 3.55 etc)
Numbers
• Types
– Integers / (Long integers)
• Ex: 2 , 100 etc
– Floating points– Floating points
• Ex: 2.35 , 5.555 , 12.5E4 (means 12.5 * 104) etc
– Complex Numbers
• Ex: 5+4j
Strings
• String – Sequence of Character
• Strings – Sequence of Words
– Ex: “Hello World”
• Using Strings – Need Understanding using of• Using Strings – Need Understanding using of
– Single Quotes
– Double Quotes
– Triple Quotes
– Escape Sequences
Using Quotes
• Single Quotes – ‘ ‘
Ex : ‘Kiel is beautiful’
• Double Quotes
Ex: “What’s your name ? ”Ex: “What’s your name ? ”
• Triple Quotes
– Multiline.
– Can Enclose both single and double quotes
– We will see later
TASK:
• Print the following:
– What is your name ?
– What’s your name ?– What’s your name ?
– ‘PYTHON’
– “PYTHON”
TASK
• Try printing the following
– What’s your name ? ( using single quotes )
– Abt– Abt
– “Hello World” (using double quotes)
Escape Sequences
•  - is an escape sequence
• It gives the special meaning to the character
following it.
• (It removes the normal meaning of the• (It removes the normal meaning of the
character following it.)
• Ex: ‘What’s your name ? ‘
Few Escape Sequences
• ’ – Single quote
• ” – Double Quote
•  - Backslash
• n – New line• n – New line
• t - Tab
• TASK
• Print:
This Is First Line
This is Second LineThis is Second Line
Triple Quotes
• ‘’’
• “””
• We can use both single and double quotes• We can use both single and double quotes
freely inside triple quotes
• But  retain its property
• Rarely Used – No need to worry about it
Variables
• They are exactly what they mean – their value
can vary
• Part of computer memory where you can
store informationstore information
• If its in memory, how can a program access it?
• So we have names for variables ☺
• (Same reason as we have names for people)
• Ex: a, variable etc
Rules for Naming
• The first character of the identifier must be a letter of the
alphabet (upper or lowercase) or an underscore('_').
• The rest of the identifier name can consist of letters (upper or
lowercase), underscores ('_') or digits (0-9).lowercase), underscores ('_') or digits (0-9).
• Identifier names are case-sensitive.
Task : Identify the Valid or Invalid
variable name
• i
• 2things
• this is varible
• My-name• My-name
• _my_name
• Name_23
• and
Keywords in Python
• and
• exec
• not
• assert
• finally
• or
• break
• global
• raise
• def
• if
• return
• del
• import
• try
• break
• for
• pass
• class
• from
• print
• continue
• try
• elif
• in
• while
• else
• is
• with
• except
• lambda
• yield
Comments
• # - Is used to write a comment
• Ex: print “hello” # prints hello
• The words following # is ignored• The words following # is ignored
White Spaces
• White spaces are ignored
• Ex: print “Hello”
• Ex: a = 123
Multiple Statements in Same Line
• ; is used to end the statement
• Ex: a = 10; b = 20; print a; print b;
References
• Python Tutorial by Tutorialspoint.com
• A Byte of Python by Swaroop C H

More Related Content

PPTX
Computer system architecture
PPTX
Static keyword ppt
PPTX
Procedural vs. object oriented programming
PDF
CS6401 OPERATING SYSTEMS Unit 2
PPTX
Software Engineering Practice
PPTX
Database System Architectures
PPTX
ProLog (Artificial Intelligence) Introduction
PPTX
Phases of compiler
Computer system architecture
Static keyword ppt
Procedural vs. object oriented programming
CS6401 OPERATING SYSTEMS Unit 2
Software Engineering Practice
Database System Architectures
ProLog (Artificial Intelligence) Introduction
Phases of compiler

What's hot (20)

PPT
SOFTWARE QUALITY ASSURANCE.ppt
PPT
Compiler Design
PPTX
Java literals
PPTX
Process synchronization
PPT
Unit 1 sepm software myths
PPT
MYSQL - PHP Database Connectivity
PPTX
Chapter 3 servlet & jsp
PPTX
Software Architecture
PPTX
Allocation and free space management
PPTX
QSpiders - Jdk Jvm Jre and Jit
PPTX
verification and validation
PPT
Fundamentals of Database system
PDF
Software engineering lecture notes
PPT
Greedy method by Dr. B. J. Mohite
PPTX
PPT
Java Presentation
PPTX
Distributed database
PPTX
Introduction to python for Beginners
PPT
Decision making and loop in C#
PDF
Lecture Notes-Finite State Automata for NLP.pdf
SOFTWARE QUALITY ASSURANCE.ppt
Compiler Design
Java literals
Process synchronization
Unit 1 sepm software myths
MYSQL - PHP Database Connectivity
Chapter 3 servlet & jsp
Software Architecture
Allocation and free space management
QSpiders - Jdk Jvm Jre and Jit
verification and validation
Fundamentals of Database system
Software engineering lecture notes
Greedy method by Dr. B. J. Mohite
Java Presentation
Distributed database
Introduction to python for Beginners
Decision making and loop in C#
Lecture Notes-Finite State Automata for NLP.pdf
Ad

Viewers also liked (20)

PDF
Java OOP Programming language (Part 1) - Introduction to Java
PDF
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...
PDF
Learning notes of r for python programmer (Temp1)
PPTX
Introduction to Advanced Javascript
PDF
Meetup Python Nantes - les tests en python
PPT
Operator Overloading
PDF
PyCon 2013 : Scripting to PyPi to GitHub and More
PDF
Installing Python on Mac
PDF
Python for All
PDF
Lesson1 python an introduction
PDF
Introduction to python
PDF
Python master class part 1
DOCX
Introduction to Python - Running Notes
PDF
Introduction to facebook java script sdk
PPTX
Lec02 structures (2)
PDF
Introduction to facebook javascript sdk
PPTX
Mastering python lesson2
PDF
Running openCV project on Mac OS
PDF
Concise Notes on Python
PPTX
Python Basis Tutorial
Java OOP Programming language (Part 1) - Introduction to Java
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...
Learning notes of r for python programmer (Temp1)
Introduction to Advanced Javascript
Meetup Python Nantes - les tests en python
Operator Overloading
PyCon 2013 : Scripting to PyPi to GitHub and More
Installing Python on Mac
Python for All
Lesson1 python an introduction
Introduction to python
Python master class part 1
Introduction to Python - Running Notes
Introduction to facebook java script sdk
Lec02 structures (2)
Introduction to facebook javascript sdk
Mastering python lesson2
Running openCV project on Mac OS
Concise Notes on Python
Python Basis Tutorial
Ad

Similar to Python - Lecture 1 (20)

PPTX
Python Lecture 2
PDF
Python Data Types
PPTX
VARIABLES AND DATA TYPES IN PYTHON NEED TO STUDY
PPTX
PART 1 - Python Tutorial | Variables and Data Types in Python
PDF
Module1PPT.pdf ,introduction to python programing
PDF
Advance Python Programming until operators.pdf
PDF
Notes1
PPTX
Python unit 1 (1).pptx
PDF
Lecture 0 - CS50's Introduction to Programming with Python.pdf
PPTX
Biswa Sir Python Fundamentals.pptx
PPTX
The Literals and Variables Concept in Python.pptx
PPTX
CH6 - Fundamentals of Python.pptx
PPTX
Python_Modullllllle_2-_AFV._Funda-1.pptx
PPTX
Chapter 6 Python Fundamentals.pptx
PPTX
Chapter 6 Python Fundamentals.pptx
PDF
AmI 2015 - Python basics
PPTX
BASICS OF PYTHON usefull for the student who would like to learn on their own
ODP
An Intro to Python in 30 minutes
PPTX
presentation_python_7_1569170870_375360.pptx
PPTX
python fudmentalsYYour score increaseases
Python Lecture 2
Python Data Types
VARIABLES AND DATA TYPES IN PYTHON NEED TO STUDY
PART 1 - Python Tutorial | Variables and Data Types in Python
Module1PPT.pdf ,introduction to python programing
Advance Python Programming until operators.pdf
Notes1
Python unit 1 (1).pptx
Lecture 0 - CS50's Introduction to Programming with Python.pdf
Biswa Sir Python Fundamentals.pptx
The Literals and Variables Concept in Python.pptx
CH6 - Fundamentals of Python.pptx
Python_Modullllllle_2-_AFV._Funda-1.pptx
Chapter 6 Python Fundamentals.pptx
Chapter 6 Python Fundamentals.pptx
AmI 2015 - Python basics
BASICS OF PYTHON usefull for the student who would like to learn on their own
An Intro to Python in 30 minutes
presentation_python_7_1569170870_375360.pptx
python fudmentalsYYour score increaseases

More from Ravi Kiran Khareedi (11)

PDF
Python - Lecture 12
PDF
Python - Lecture 11
PDF
Python - Lecture 10
PDF
Python - Lecture 9
PDF
Python - Lecture 8
PDF
Python - Lecture 7
PDF
Python - Lecture 6
PDF
Python - Lecture 5
PDF
Python - Lecture 4
PDF
Python - Lecture 3
PDF
Python - Lecture 2
Python - Lecture 12
Python - Lecture 11
Python - Lecture 10
Python - Lecture 9
Python - Lecture 8
Python - Lecture 7
Python - Lecture 6
Python - Lecture 5
Python - Lecture 4
Python - Lecture 3
Python - Lecture 2

Recently uploaded (20)

PDF
August Patch Tuesday
PDF
Hybrid model detection and classification of lung cancer
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Tartificialntelligence_presentation.pptx
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
STKI Israel Market Study 2025 version august
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
What is a Computer? Input Devices /output devices
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Architecture types and enterprise applications.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
August Patch Tuesday
Hybrid model detection and classification of lung cancer
WOOl fibre morphology and structure.pdf for textiles
Tartificialntelligence_presentation.pptx
sustainability-14-14877-v2.pddhzftheheeeee
STKI Israel Market Study 2025 version august
Benefits of Physical activity for teenagers.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Assigned Numbers - 2025 - Bluetooth® Document
What is a Computer? Input Devices /output devices
A comparative study of natural language inference in Swahili using monolingua...
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
A review of recent deep learning applications in wood surface defect identifi...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Architecture types and enterprise applications.pdf
1 - Historical Antecedents, Social Consideration.pdf

Python - Lecture 1

  • 1. Python Tutorial Lecture - 1Lecture - 1 -Ravi Kiran Khareedi
  • 2. Why Python ? • Simple to use • Powerful (Extensive Libraries) • Free and Open Source ☺ • Portable (Windows, Mac, Linux..)• Portable (Windows, Mac, Linux..) • And Many more…
  • 3. Basics • Literal Constants – The value we use literally. – There are values used to assign to variables Types of LiteralsTypes of Literals – Strings (Ex: ‘This is Python’ , “It’s good”) – Number (Ex: 2 , 3.55 etc)
  • 4. Numbers • Types – Integers / (Long integers) • Ex: 2 , 100 etc – Floating points– Floating points • Ex: 2.35 , 5.555 , 12.5E4 (means 12.5 * 104) etc – Complex Numbers • Ex: 5+4j
  • 5. Strings • String – Sequence of Character • Strings – Sequence of Words – Ex: “Hello World” • Using Strings – Need Understanding using of• Using Strings – Need Understanding using of – Single Quotes – Double Quotes – Triple Quotes – Escape Sequences
  • 6. Using Quotes • Single Quotes – ‘ ‘ Ex : ‘Kiel is beautiful’ • Double Quotes Ex: “What’s your name ? ”Ex: “What’s your name ? ” • Triple Quotes – Multiline. – Can Enclose both single and double quotes – We will see later
  • 7. TASK: • Print the following: – What is your name ? – What’s your name ?– What’s your name ? – ‘PYTHON’ – “PYTHON”
  • 8. TASK • Try printing the following – What’s your name ? ( using single quotes ) – Abt– Abt – “Hello World” (using double quotes)
  • 9. Escape Sequences • - is an escape sequence • It gives the special meaning to the character following it. • (It removes the normal meaning of the• (It removes the normal meaning of the character following it.) • Ex: ‘What’s your name ? ‘
  • 10. Few Escape Sequences • ’ – Single quote • ” – Double Quote • - Backslash • n – New line• n – New line • t - Tab
  • 11. • TASK • Print: This Is First Line This is Second LineThis is Second Line
  • 12. Triple Quotes • ‘’’ • “”” • We can use both single and double quotes• We can use both single and double quotes freely inside triple quotes • But retain its property • Rarely Used – No need to worry about it
  • 13. Variables • They are exactly what they mean – their value can vary • Part of computer memory where you can store informationstore information • If its in memory, how can a program access it? • So we have names for variables ☺ • (Same reason as we have names for people) • Ex: a, variable etc
  • 14. Rules for Naming • The first character of the identifier must be a letter of the alphabet (upper or lowercase) or an underscore('_'). • The rest of the identifier name can consist of letters (upper or lowercase), underscores ('_') or digits (0-9).lowercase), underscores ('_') or digits (0-9). • Identifier names are case-sensitive.
  • 15. Task : Identify the Valid or Invalid variable name • i • 2things • this is varible • My-name• My-name • _my_name • Name_23 • and
  • 16. Keywords in Python • and • exec • not • assert • finally • or • break • global • raise • def • if • return • del • import • try • break • for • pass • class • from • print • continue • try • elif • in • while • else • is • with • except • lambda • yield
  • 17. Comments • # - Is used to write a comment • Ex: print “hello” # prints hello • The words following # is ignored• The words following # is ignored
  • 18. White Spaces • White spaces are ignored • Ex: print “Hello” • Ex: a = 123
  • 19. Multiple Statements in Same Line • ; is used to end the statement • Ex: a = 10; b = 20; print a; print b;
  • 20. References • Python Tutorial by Tutorialspoint.com • A Byte of Python by Swaroop C H