Introduction to python
S.NO TOPIC PAGE
1. What is Python: 3
2. What can Python do: 4
3. History and uses: 5-7
4. Python Data Types: 8-10
5. Python Operators: 11-18
6. Strings and Arguments: 19-25
7. Modules, Python dates
and Reg Ex function
and Meta character:
26-29
Topic to discuss about:
 Python is a popular programming language. Its was
created by Guido Van Rossum and revealed in 1991.
 Python is commonly used for developing websites and
software, task automation, data analysis, and data
visualization.
 Since it's relatively easy to learn, Python has been
adopted by many non-programmers, such as
accountants and scientists, for a variety of everyday
tasks, like organizing finances.
What is Python?
 Python can be used on a server to create web
application.
 Python can be used alongside software to create
workflows.
 Python can connect to database system. It can also read
and modify files.
What can Python do?
 Invented in the
Netherlands.
 Python was created by
Guido Van Rossum , and
first released on February
20,1991.
 Python is named after
‘Monty Python’s Flying
Circus’ which is a famous
TV show in Netherlands.
History…..
 Developing websites and software.
 Data Analysis.
 Game development.
 Data visualization.
What are the uses ?
How To Install Python
Website:-https://www.python.org/
downloads/
Python Data types:
 Text Types:
 Numeric Types:
 Sequence Types:
 Mapping Types:
 Set Types:
 Boolean Types:
 Binary Types:
 str
 Int, float, complex
 List , tuple ,range
 Dict
 Set , frozen set
 Bool
 Btyes , byte array ,
memory view
Data Types In Python
 Arithmetic operators.
 Assignment operators.
 Comparison operators.
 Logical operators.
 Identity operators.
 Membership operators.
 Bitwise operators.
Python Operators:
 Are as follow:
Identity operators:
1.String is a collection of
alphabets, words or other
characters.
2.It is one of the primitive
data structures and are the
building blocks for data
manipulation.
3.Python has a built-in string
class named str.
STRING(STR)
 Information can be passed into function as arguments.
 Parameters or Arguments:
1. A parameters is the variable listed the parenthesis in the
function defination.
2. An argument is the value that is sent to the function when its
is called.
Arguments
5 Arguments in Python to Know
 Default arguments.
 Keyword arguments.
 Positional arguments.
 Arbitrary positional arguments.
 Arbitrary keyword arguments.
Types of function arguments:
 Default arguments in Python represent the function
arguments that will be used if no arguments are passed
to the function call. The default arguments are
represented as argument name = value in the function
definition. Default arguments in Python can be used
with keyword and positional arguments.
Default Arguments:
Keyword arguments (or named arguments) are values
that, when passed into a function, are identifiable by
specific parameter names. A keyword argument is
preceded by a parameter and the assignment operator, = .
Keyword arguments can be likened to dictionaries in that
they map a value to a keyword.
Keyword Arguments:
 Positional arguments are arguments that need to be
included in the proper position or order. The first
positional argument always needs to be listed first
when the function is called. The second positional
argument needs to be listed second and the third
positional argument listed third, etc.
Positional Variables:
 Python Arbitrary Arguments allows a function to accept
any number of positional arguments i.e. arguments that
are non-keyword arguments, variable-length argument
list.
Arbitrary Arguments:
 In Python, Modules are simply files with the “. py”
extension containing Python code that can be imported
inside another Python Program. In simple terms, we
can consider a module to be the same as a code library
or a file that contains a set of functions that you want to
include in your application.
Modules:
 Directive Description Example Try it
 %a Weekday, short version Wed
 %A Weekday, full version Wednesday
 %w Weekday as a number 0-6, 0 is Sunday 3
 %d Day of month 01-31 31
 %b Month name, short version Dec
 %B Month name, full version December
 %m Month as a number 01-12 12
 %y Year, short version, without century 18
 %Y Year, full version 2018
 %H Hour 00-2317
 %I Hour 00-1205
 %p AM/PM PM
 %M Minute 00-59 41
 %S Second 00-59 08
 %f Microsecond 000000-999999 548513
 %z UTC offset +0100
 %Z Time zone CST
 %j Day number of year 001-366 365
 %U Week number of year, Sunday as the first day of week, 00-53 52
 %W Week number of year, Monday as the first day of week, 00-53 52
 %c Local version of date and time Mon Dec 31 17:41:00 2018
 %C Century 20
 %x Local version of date 12/31/18
 %X Local version of time 17:41:00
 %% A % character %
 %G ISO 8601 year 2018
 %u ISO 8601 weekday (1-7) 1
 %V ISO 8601 week number (01-53) 01
Pythons Dates:
 A Reg Ex, or Regular Expression, is a sequence of
characters that forms a search pattern. Reg Ex can be
used to check if a string contains the specified ...
 Function Description
 Find all : Returns a list containing all matches
 Search : Returns a Match object if there is a match
anywhere in the string
 Split : Returns a list where the string has been split at
each match
 Sub : Replaces one or many matches with a string
Reg Ex Functions:
 Meta character Description Example
 [] It represents the set of characters. "[a-z]"
  It represents the special sequence. "r"
 . It signals that any character is present at some specific place. "Ja.v."
 ^ It represents the pattern present at the beginning of the string.
"^Java"
 $ It represents the pattern present at the end of the string. "point"
 * It represents zero or more occurrences of a pattern in the string.
"hello*"
 + It represents one or more occurrences of a pattern in the string.
"hello+"
 {} The specified number of occurrences of a pattern the string.
"java{2}"
 | It represents either this or that character is present. "java|point“.
 () Capture and group (java tpoint).
Meta-Characters:
THE END
By:- Lakshya Sharma
3rd sem, CSE-AI(B-Tech)

lakshya's ppt python for final final.pptx

  • 1.
  • 2.
    S.NO TOPIC PAGE 1.What is Python: 3 2. What can Python do: 4 3. History and uses: 5-7 4. Python Data Types: 8-10 5. Python Operators: 11-18 6. Strings and Arguments: 19-25 7. Modules, Python dates and Reg Ex function and Meta character: 26-29 Topic to discuss about:
  • 3.
     Python isa popular programming language. Its was created by Guido Van Rossum and revealed in 1991.  Python is commonly used for developing websites and software, task automation, data analysis, and data visualization.  Since it's relatively easy to learn, Python has been adopted by many non-programmers, such as accountants and scientists, for a variety of everyday tasks, like organizing finances. What is Python?
  • 4.
     Python canbe used on a server to create web application.  Python can be used alongside software to create workflows.  Python can connect to database system. It can also read and modify files. What can Python do?
  • 5.
     Invented inthe Netherlands.  Python was created by Guido Van Rossum , and first released on February 20,1991.  Python is named after ‘Monty Python’s Flying Circus’ which is a famous TV show in Netherlands. History…..
  • 6.
     Developing websitesand software.  Data Analysis.  Game development.  Data visualization. What are the uses ?
  • 7.
    How To InstallPython Website:-https://www.python.org/ downloads/
  • 8.
  • 9.
     Text Types: Numeric Types:  Sequence Types:  Mapping Types:  Set Types:  Boolean Types:  Binary Types:  str  Int, float, complex  List , tuple ,range  Dict  Set , frozen set  Bool  Btyes , byte array , memory view Data Types In Python
  • 11.
     Arithmetic operators. Assignment operators.  Comparison operators.  Logical operators.  Identity operators.  Membership operators.  Bitwise operators. Python Operators:
  • 16.
     Are asfollow: Identity operators:
  • 19.
    1.String is acollection of alphabets, words or other characters. 2.It is one of the primitive data structures and are the building blocks for data manipulation. 3.Python has a built-in string class named str. STRING(STR)
  • 20.
     Information canbe passed into function as arguments.  Parameters or Arguments: 1. A parameters is the variable listed the parenthesis in the function defination. 2. An argument is the value that is sent to the function when its is called. Arguments
  • 21.
    5 Arguments inPython to Know  Default arguments.  Keyword arguments.  Positional arguments.  Arbitrary positional arguments.  Arbitrary keyword arguments. Types of function arguments:
  • 22.
     Default argumentsin Python represent the function arguments that will be used if no arguments are passed to the function call. The default arguments are represented as argument name = value in the function definition. Default arguments in Python can be used with keyword and positional arguments. Default Arguments:
  • 23.
    Keyword arguments (ornamed arguments) are values that, when passed into a function, are identifiable by specific parameter names. A keyword argument is preceded by a parameter and the assignment operator, = . Keyword arguments can be likened to dictionaries in that they map a value to a keyword. Keyword Arguments:
  • 24.
     Positional argumentsare arguments that need to be included in the proper position or order. The first positional argument always needs to be listed first when the function is called. The second positional argument needs to be listed second and the third positional argument listed third, etc. Positional Variables:
  • 25.
     Python ArbitraryArguments allows a function to accept any number of positional arguments i.e. arguments that are non-keyword arguments, variable-length argument list. Arbitrary Arguments:
  • 26.
     In Python,Modules are simply files with the “. py” extension containing Python code that can be imported inside another Python Program. In simple terms, we can consider a module to be the same as a code library or a file that contains a set of functions that you want to include in your application. Modules:
  • 27.
     Directive DescriptionExample Try it  %a Weekday, short version Wed  %A Weekday, full version Wednesday  %w Weekday as a number 0-6, 0 is Sunday 3  %d Day of month 01-31 31  %b Month name, short version Dec  %B Month name, full version December  %m Month as a number 01-12 12  %y Year, short version, without century 18  %Y Year, full version 2018  %H Hour 00-2317  %I Hour 00-1205  %p AM/PM PM  %M Minute 00-59 41  %S Second 00-59 08  %f Microsecond 000000-999999 548513  %z UTC offset +0100  %Z Time zone CST  %j Day number of year 001-366 365  %U Week number of year, Sunday as the first day of week, 00-53 52  %W Week number of year, Monday as the first day of week, 00-53 52  %c Local version of date and time Mon Dec 31 17:41:00 2018  %C Century 20  %x Local version of date 12/31/18  %X Local version of time 17:41:00  %% A % character %  %G ISO 8601 year 2018  %u ISO 8601 weekday (1-7) 1  %V ISO 8601 week number (01-53) 01 Pythons Dates:
  • 28.
     A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern. Reg Ex can be used to check if a string contains the specified ...  Function Description  Find all : Returns a list containing all matches  Search : Returns a Match object if there is a match anywhere in the string  Split : Returns a list where the string has been split at each match  Sub : Replaces one or many matches with a string Reg Ex Functions:
  • 29.
     Meta characterDescription Example  [] It represents the set of characters. "[a-z]"  It represents the special sequence. "r"  . It signals that any character is present at some specific place. "Ja.v."  ^ It represents the pattern present at the beginning of the string. "^Java"  $ It represents the pattern present at the end of the string. "point"  * It represents zero or more occurrences of a pattern in the string. "hello*"  + It represents one or more occurrences of a pattern in the string. "hello+"  {} The specified number of occurrences of a pattern the string. "java{2}"  | It represents either this or that character is present. "java|point“.  () Capture and group (java tpoint). Meta-Characters:
  • 30.
    THE END By:- LakshyaSharma 3rd sem, CSE-AI(B-Tech)