myassignmenthelp.net provides in all assignments and projects related to python. Go through ppt for more details about python programming languages.Incase you need help with any of the task related to programming feel free to get in touch with us.
2. What is Python
⢠Multi-purpose i.e, Web, Graphical user interface
(GUI), Scripting and many others.
⢠Strongly typed as well as dynamically typed.
⢠Focus on readability as well as productivity.
⢠Object oriented.
⢠Interpreted.
www.myassignmenthelp.net
3. Characteristics
⢠Easy to Learn
⢠High-level Language
⢠Interactive shell
⢠Strong introspection
⢠Cross platform
⢠Object Oriented
⢠Everything is an object
⢠Free and Open Source
www.myassignmenthelp.net
4. CONT..
⢠Useful built-in types (lists, dictionaries)
⢠Clean syntax, powerful extensions
⢠Interpreted
⢠Interactive
⢠Commonly used for producing HTML content on
websites. Great for text files
⢠Functional
⢠Extensive Libraries
www.myassignmenthelp.net
6. The Python Interpreter
⢠Python can be an
interpreted terminology
⢠The actual interpreter
has an interactive
environment in order to
perform using the
language
⢠Results
>>>> 4 + 5
9
>>>> 4 < 15
True
>>>> âprint meâ
âprint meâ
>>>> print âprint meâ
print me
>>> >
www.myassignmenthelp.net
7. Print âHello Worldâ
⢠Open a terminal window and type âpythonâ
⢠If on Windows open a Python IDE such as IDLE
⢠At the prompt type âHello World !!â
>>>> âHello World !!'
âHello World !!'
www.myassignmenthelp.net
8. The print Statement
>>>> print âWelcomeâ
Welcome
>>>> print âWelcomeâ, âRamâ
Welcome Ram
⢠Elements divided
through commas , print
with a space between
them
⢠The comma at the
end from the statement
(print âWelcomeâ,)
won't printing the new
line character
www.myassignmenthelp.net
9. The Documentation
>>> > âwelcome'
âwelcome'
>>> #âcomment'
>>>
â#â : this symbol is used for starts a
comment
www.myassignmenthelp.net
10. Variables
⢠Do not need to declare
⢠Should determine (initialize)
⢠Using uninitialized variable improves
exception
⢠Certainly not typed
in case ,friendly: greeting = âHello World"
else: greeting = 12**2
print greeting
⢠Anything is often a âvariableâ:
⢠Even characteristics, classes, modules
www.myassignmenthelp.net
11. Everything is an object
⢠Everything means,
which includes
functions as well as
classes
⢠Data type is usually a
property of the object
instead of on the
variable
>>>> x = 9
>>> x
9
>>>> x = âWelcomeâ
>>>> x
âWelcomeâ
>>>>
www.myassignmenthelp.net
12. Interactive âShellâ
⢠This is good for learning the language
⢠Good for experimenting for using your library
⢠Good for testing for using your own modules
⢠2 variants: IDLE (GUI),
python (command line)
⢠Kind statements or even expressions at prompt:
www.myassignmenthelp.net
>>>> print "Hello, World"
Hello, World
>>>> x = 12**2
>>>> x/2
72
>>>> # (this is a comment)
13. Numbers
⢠The typical suspects:
⢠13, 3.15, 0xFF, 0377, (-1+2)*3/4**5, abs(x), 0<x<=5
⢠C-style shifting & masking:
⢠1<<17, x&0xff, x|1, ~x, x^y
⢠Integer division truncates:
⢠1/2 -> 0 # 1./2. -> 0.5, float(1)/2 -> 0.5
⢠fixed in the future
⢠Long complicated:
⢠2L**100 -> 1267650600228229401497607505376L
â Within Python 2.2 as well as past, 2**100 will the
same
www.myassignmenthelp.net
15. Lists
⢠Variable arrays, definitely, not Lisp-like
linked lists
⢠x = [99, [âonâ, âtheâ, âwallâ]]
⢠Exact same providers for strings
⢠x+y, x*3, x[0], x[-1], x[1:], len(x)
⢠Item and slice assignment
⢠x[0] = 98
-> [98, [âonâ, âtheâ, âwallâ]]
⢠del x[-1] # -> [98]
www.myassignmenthelp.net
16. Tuples
⢠Tuples tend to be
immutable versions
associated with lists
⢠One strange may be the
structure to create a tuple
along with one element:
â,â is required to
differentiate from the
numerical expression (2)
>>>> a = (1,2,3)
>>> >a[1:]
(2, 3)
>>>> b = (2,)
>>> >b
(2,)
>>> >
www.myassignmenthelp.net
17. Dictionaries
⢠Some key-value sets
⢠Dictionaries tend to be mutable
>>> x = {1 : âWelcome', âTwo' : 32, âHi' : [4,5,6]}
>>> x
{1: âWelcome', âTwo': 32, âHi': [1, 2, 3]}
>>> x[âHi']
[4,5,6]
www.myassignmenthelp.net
18. Standard Library
⢠Core:
â operating system, sys, string, StringIO, struct, pickle etc
⢠Regular expressions:
â re module, Perl-5 style patterns as well as matching
rules
⢠Web:
â socket, rfc822, httplib, htmllib etc
⢠Miscellaneous:
â pdb
â Tkinter, audio etc
www.myassignmenthelp.net