krishan123sharma123
15 views
30 slides
Oct 04, 2024
Slide 1 of 30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
About This Presentation
python presentation on college internship programme.
Size: 1.11 MB
Language: en
Added: Oct 04, 2024
Slides: 30 pages
Slide Content
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 N etherlands. History…..
Developing websites and software. Data Analysis. Game development. Data visualization. What are the uses ?
How T o I nstall Python Website:-https ://www.python.org/downloads/
Python Data types:
Text Types: Numeric Types: Sequence Types: Mapping Types: Set Types: Boolean Types: Binary Types: s tr Int, float, complex List , tuple ,range Dict Set , frozen set Bool Btyes , byte array , memory view Data Types In Python
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: A parameters is the variable listed the parenthesis in the function defination. 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-23 17 %I Hour 00-12 05 %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:- L akshya Sharma 3rd sem, CSE-AI(B-Tech)