Title: python assignment help at myassignmenthelp
1 Python assignment help
2What 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.
3Characteristics
- Easy to Learn
- High-level Language
- Interactive shell
- Strong introspection
- Cross platform
- Object Oriented
- Everything is an object
- Free and Open Source
4CONT..
- 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
5Languages
- Few important types
- FORTRAN
- Technology
- COBOL
- Business Information
- LISP
- Logic as well as AI
- BASIC
- Easy Language
6The Python Interpreter
- Python can be an interpreted terminology
- The actual interpreter has an interactive
environment in order to perform using the
language - Results
gtgtgtgt 4 5 9 gtgtgtgt 4 lt 15 True gtgtgtgt print
me print me gtgtgtgt print print me print me gtgtgt
gt
7Print 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 !!
gtgtgtgt Hello World !!' Hello World !!'
8The print Statement
- 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
gtgtgtgt print Welcome Welcome gtgtgtgt print
Welcome, Ram Welcome Ram
9The Documentation
this symbol is used for starts a comment
gtgtgt gt welcome' welcome' gtgtgt comment' gtgtgt
10Variables
- Do not need to declare
- Should determine (initialize)
- Using uninitialized variable improves exception
- Certainly not typed
- in case ,friendly greeting Hello World"
- else greeting 122
- print greeting
- Anything is often a variable
- Even characteristics, classes, modules
11Everything 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
gtgtgtgt x 9 gtgtgt x 9 gtgtgtgt x Welcome gtgtgtgt
x Welcome gtgtgtgt
12Interactive 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
gtgtgtgt print "Hello, World" Hello, World gtgtgtgt x
122 gtgtgtgt x/2 72 gtgtgtgt (this is a comment)
13Numbers
- The typical suspects
- 13, 3.15, 0xFF, 0377, (-12)3/45, abs(x),
0ltxlt5 - C-style shifting masking
- 1ltlt17, x0xff, x1, x, xy
- Integer division truncates
- 1/2 -gt 0 1./2. -gt 0.5, float(1)/2 -gt 0.5
- fixed in the future
- Long complicated
- 2L100 -gt 1267650600228229401497607505376L
- Within Python 2.2 as well as past, 2100 will
the same
14Strings
- Hello World HelloWorld Concatenation
- Hello2 HelloHello Repetition
- Hello0 h Indexing
- Hello-1 o (From end)
- Hello14 ell Slicing
- len(Hello) 5 Size
- Hellolt jello 1 Comparison
- e in hello 1 Search
- escapes \n etc, \033 etc, \if etc
- 'single quotes' """triple quotes""" r raw
strings
15Lists
- Variable arrays, definitely, not Lisp-like linked
lists - x 99, on, the, wall
- Exact same providers for strings
- xy, x3, x0, x-1, x1, len(x)
- Item and slice assignment
- x0 98
- -gt 98, on, the, wall
- del x-1 -gt 98
16Tuples
- 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)
gtgtgtgt a (1,2,3) gtgtgt gta1 (2, 3) gtgtgtgt b
(2,) gtgtgt gtb (2,) gtgtgt gt
17Dictionaries
- Some key-value sets
- Dictionaries tend to be mutable
gtgtgt x 1 Welcome', Two' 32, Hi'
4,5,6 gtgtgt x 1 Welcome', Two' 32, Hi'
1, 2, 3 gtgtgt xHi' 4,5,6
18Standard 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
19