Академический Документы
Профессиональный Документы
Культура Документы
1
Lecture 2
2
History Of Python
Python was conceived in 1980s, and its implementation began in
December 1989 by Guido van Rossum at Centrum Wiskunde &
Informatica (CWI) in the Netherlands as a successor to the ABC
language.
His office would be closed, but he had a home computer, and not much
else on his hands.
Python 2.0 was released on 16 October 2000 and had many major new
features, including a garbage collector and support for Unicode.
5
Versions of Python
The programs written in Python 3 will not run in Python2.
Note:
We will learn programming using Python 3 in our course
6
Python Programming Modes
Both the command-line Python interpreter and IDLE are available after Python is
installed on your machine.
Script mode is perfect for writing programs you can run later.
Even though we need only script mode to write a program but always keep an
interactive window open.
8
Programming Errors
1. Syntax Errors
The most common error you will encounter are syntax errors. Like any programming
language, Python has its own syntax, and you need to write code that obeys the
syntax rules. If your program violates the rules Python will report syntax errors.
Syntax errors result from errors in code construction, such as mistyping a statement,
incorrect indentation, omitting some necessary punctuation, or using an opening
parenthesis without a corresponding closing parenthesis. These errors are usually
easy to detect, because Python tells you where they are and what caused them.
9
Programming Errors
2. Runtime Errors
Runtime errors are errors that cause a program to terminate abnormally. They occur
3. Logical/Sementic Errors
Logical errors occur when a program does not perform the way it was intended to.
10
Words
Keywords: Keywords, also called reserved words, have special meanings in Python.
These are predefined to language translator.
Identifiers: These are user defined words.
Structured Statements
1. Selection
2. Iterative
3. Compound
12