article ARTICLE
article3 min read

Python programming language

This language was written by the Dutch developer Guido van Rossum in the late of 1980-1990. The version 2.0 was released on October 16, 2000, and the version3.0, which is not generally compatible with previous releases on December 3,2008.
Pythonis a "high level" language (other examples of such languages are FORTRAN, C, Java etc). The code of such a language must be converted to a "machine language" to be executed by the PC. This is done by interpreters and compilers. In the case of python, the processing is done by interpreters.
Python is a programming language with simple syntax, excellent readability, portability,and has modern features that make it suitable as the most approachable programming language. Its success is largely due to the fact that it is an interpreted language. This means that the Python compiler produces intertextual (bytecode)code that can be executed by the interpreter in many different computationalenvironments. Interpreters for Python are available for all popular operating, such as Windows, Linux, MacOS.
If your personal computer uses the Linux or MacOS operating system then Python is already installed (make sure you have the Python 3 interpreter). Otherwise, you can install the Python envelope named Canopy from the Enthought website.
Many peple use the Linux operating system and have, of course, installed the interpreter for Python 3. They also contain the IDLE shell, an interactive Python interpreter with a built-in copywriter. The workshops of the course willbe on these computer systems, but you can use your own laptop.
The Python programming language has lots of benefits because:
·        It is an Open Source Language (available at http://python.org).
·         It is of general purpose
·        It is a high level programming language.
·        It is easy to be learned (simple syntax). 
·        It has possibilities in various directions (powerful programming language). 
·        It is suitable for beginners and experienced developers. 
·        It is object-oriented, as there are several support packages (libraries)
Variable operations with Numbers: We can give multiplication and division of numbers toget the result
Types of variables: 1. int (integer) 2. float 3. bool (logical variable: gets True orFalse) 4. NoneType (takes the value None, indicates no value)
Variable names: They may contain letters and numbers (alphanumeric characters) but they must start with one letter. The pedestrians are distinguished by capitals. It may contain the underscore (_).
Keywords: They are reserved words of special importance. Some of them are >>> keyword. kwlist ['False', 'None','True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del','elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import','in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return','try', 'while', 'with', 'yield'].
Errors:
Editorial error. Let's look at the following
>>>print c SyntaxError: Missing parentheses in call to 'print' >>>print(c,Nick) Traceback (most recent call last):   File "", line 1, in      print(c,Nick) NameError: name 'Nick' isnot defined 
The first command has a syntax error that Python calls SyntaxError. The second command has an error that Python calls NameError. The interpreter gives us information about each mistake.
Let’s see some examples of important errors. 
>>>print (3,2) 3 2
We printed two numbers. There seems to be no mistake in the above. But if your purpose was to print 3.2, then we have made a semantic error. That is, the command gives a result, but it is not what we wanted.

Groups

7
  •  Inspiring
  • comment_icon  Comment