python assignment help

13
PYTHON ASSIGNMENT HELP http://www.myassignmenthelpers.com [email protected]

Upload: jacob-william

Post on 14-Feb-2017

290 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Python Assignment Help

PYTHON ASSIGNMENT HELP

http://www.myassignmenthelpers.com/

[email protected]

Page 2: Python Assignment Help

Python Tutorial Assignments• interactive "shell"• basic types: numbers, strings• container types: lists, dictionaries, tuples• variables• control structures• functions & procedures• classes & instances• modules & packages• exceptions• files & standard library• what's new in Python 2.0 and beyond

Page 3: Python Assignment Help

Python Assignment Overview

• Programs are composed of modules• Modules contain statements• Statements contain expressions• Expressions create and process objects

Page 4: Python Assignment Help

Python Assignment Interpreter

• >>> 3 + 7• 10• >>> 3 < 15 • True• >>> 'print me'• 'print me'• >>> print 'print me'• print me• >>>

• Python is an interpreted language

• The interpreter provides an interactive environment to play with the language

• Results of expressions are printed on the screen

Page 5: Python Assignment Help

Numbers: Integers

• Integer – the equivalent of a C long• Long Integer – an unbounded integer value.

Page 6: Python Assignment Help

Numbers: Floating Point

>>> 1.232321.2323200000000001>>> print 1.232321.23232>>> 1.3E713000000.0>>> int(2.0)2>>> float(2)2.0

int(x) converts x to an integerfloat(x) converts x to a floating pointThe interpreter shows a lot of digits

Page 7: Python Assignment Help

Running Interactively on UNIX

On Unix…% python>>> 3+36

• Python prompts with ‘>>>’. • To exit Python (not Idle):– In Unix, type CONTROL-D– In Windows, type CONTROL-Z + <Enter>– Evaluate exit()

Page 8: Python Assignment Help

Editing Python in Emacs• Emacs python-mode has good support for editing Python, enabled enabled by default

for .py files• Features: completion, symbol help, eldoc, and inferior interpreter shell, etc.

Page 9: Python Assignment Help

Basic Datatypes

• Integers (default for numbers)z = 5 / 2 # Answer 2, integer division

• Floatsx = 3.456

• Strings– Can use “” or ‘’ to specify with “abc” == ‘abc’– Unmatched can occur within the string: “matt’s”– Use triple double-quotes for multi-line strings or strings

than contain both ‘ and “ inside of them: “““a‘b“c”””

Page 10: Python Assignment Help

Python Assignment• Binding a variable in Python means setting a name to hold a

reference to some object– Assignment creates references, not copies

• Names in Python do not have an intrinsic type, objects have types– Python determines the type of the reference automatically based on

what data is assigned to it• You create a name the first time it appears on the left side of an

assignment expression: x = 3

• A reference is deleted via garbage collection after any names bound to it have passed out of scope

• Python uses reference semantics (more later)

Page 11: Python Assignment Help

Python Features• no compiling or linking• rapid development cycle• no type declarations• simpler, shorter, more flexible• automatic memory management• garbage collection• high-level data types and operations• fast development• object-oriented programming• code structuring and reuse, C++• embedding and extending in C• mixed language systems• classes, modules, exceptions• "programming-in-the-large" support• dynamic loading of C modules• simplified extensions, smaller binaries• dynamic reloading of C modules• programs can be modified without stopping

Page 12: Python Assignment Help

Python structure

• modules: Python source files or C extensions– import, top-level via from, reload

• statements– control flow– create objects– indentation matters – instead of {}

• objects– everything is an object– automatically reclaimed when no longer needed

Page 13: Python Assignment Help

Language comparisonTcl Perl Pytho

nJavaScript

Visual Basic

Speed development regexp

breadth extensible embeddable easy GUI (Tk) net/web

enterprise

cross-platform

I18N thread-safe database access