Dec 7, 2014

Python Programming - 01. Introduction

Python (programming language) is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale.
http://en.wikipedia.org/wiki/Python_(programming_language)#mediaviewer/File:Python_logo_and_wordmark.svg

Code readability and both a small and large scale mean you can rapidly do prototyping systems and extend the system into a large scale. However, a large system is built on many system software and application program modules. I.e., learn more programming languages to get more opportunities, and use the right PL to do right tasks (to code right modules). Check following information and make decision to learn which programming languages.

https://www.python.org/downloads/

Use default setup

Right-click to put Python Command Line (PCL) into task bar or metro-UI

Right-click on title bar to set the PCL properties

Test Python according to your programming experience
Numeric and string operations are almost the same with most programming language.
Popular functions are also supported by Python, e.g. len() and print().
>>> 1 + 1
2
>>> 'ab' + 'CD'
'abCD'
>>> s = 'abc'
>>> len(s)
3
>>> print(s)
abc
>>> str(len(s))
'3'
>>> int('123')
123
>>> array = [1, 2, 3]
>>> print(array)
[1, 2, 3]
>>> array.reverse()
>>> print(array)
[3, 2, 1]
>>>

Array (or List) methods, such as sort() and reverse(), have no return value. Therefore,
>>> a2 = array.sort()
>>> print(a2)
None

Key-Value (Attribute-Value) structure is very easy to use in Python.
>>> kv = {'a' : 3, 'b' : 6}
>>> kv['b']
6

No comments :

Post a Comment