Wednesday, 10 December 2008

Some language characteristic in Python

''' represent multi-line String.

Raw Strings. Strings start with a r or R. r"Newlines are indicated by \n". The special character in the String is not prefixed by a escape.

Unicode Strings. Strings start with u or U. u"This is a Unicode string.". Automatically converted into Unicode format.

String literal concatenation. If you place two string literals side by side, they are automatically concatenated by Python. For example, 'What\'s' 'your name?' is automatically converted in to "What's your name?".

Notice for different kind programmers:
Note for C/C++ Programmers
There is no separate char data type in Python. There is no real need for it and I am sure you
won't miss it.

Note for Perl/PHP Programmers
Remember that single-quoted strings and double-quoted strings are the same - they do not differin any way.

Note for Regular Expression Users


Indentation in python is used to define block. And don't use a mixture of tab and whitespace to indentation

No comments: