1. The subscript starts from 0.-1 indicates the last element, and-2 indicates the second to last.2. Because sequential operations are built-in, Such'Hello' [1]Fourth = raw_input ('year: ') [3]All are valid input
3. You can use * to repeat the list
I recently downloaded a win7 wallpaper package and decompressed it. The main directory is win7wils. The following are more than 20 folders named by country, each of which contains numbers 1, 2, 3. JPG file. Because such distribution cannot use the
15:40:00 Yesterday, I spent some time reading the documentation and functions of the ftplib block. With the help of the example, I spent an hour creating an FTP client.
Program . In general, the FTP process is relatively simple. In summary, it is:
This title is intentionally confusing ......
Today, I want to try python3k. I used to enter python in the address bar and press the Control + enter key to go to the official Python website. Who knows it is not python.org, but python.com.
The biggest difference between tuple and list is that tuple's elements cannot be changed (the same as string), and almost no difference is found (
The only difference is that tuples can't be changed.)
1. After an element is added, a comma (,)
1. When two strings are put together, they are automatically merged."Let's say" '"Hello, world! "'---> 'Let/'s say" Hello, world! "'
However, when the two string variables are put together, "+" must be added to the center to merge them.
2. STR and
1. FormatFormat = 'hello, % S. Your ID is % d .'Values = ('Thy ', 38)Print format % values---> 'Hello, thy. Your ID is 38 .'As shown in the second sentence, to trim multiple elements, you can use tuple or dictionary (but not list, because list is
1. Create (note that dictionary has no sequence)
Phonebook = {'Alice ': '000000', 'beth': '000000', 'cecil ': '000000 '}
The colon is a key, followed by a value, and the key must be unique.
Items = [('name', 'gumby'), ('age', 42)]
D = dict (items)
--
Laziness is a valid ue --- Real programmers are lazy. Not lazy in a bad way, but in the sense that they don't do unnecessary work.
1. Create a functionDef fibs (Num): result = [0, 1] for I in range (num-2): result. append (result [-2] + result [-
Input in interactive mode
>>> Import this
The Zen of Python, by Tim Peters
Beautiful is better than uugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better
This article discusses the regular expression loop elimination optimization, the point-through-configuration mode in Python, And the whole row reading method in several cases.
This article is derived from a non-trivial program that extracts protein
(Occasionally, for fear of forgetting)
When a user opens a browser, clicks and other behaviors, and then obtains the results, the following methods I have used only depend on IE, but Firefox and other methods should also have corresponding call
The main function, saved as a test. py file, placed under the pyfetion folder, or set the directory by yourself.
Import osimport reimport sysimport time from pyfetion import * def sendsms (SMS ): myphone = '000000******** '# mobile phone number
Import statimport pexpect only displays the key code: sqldb = localpath + database // obtain the database name if OS. path. exists (sqldb): OS. chmod (sqldb, stat. s_irwxu) // if the database exists, it is directly changed to the read/write format
Today, I suddenly found a script language called Jython, which is a python implemented in Java.
Let's take a look at the differences between them.
Original reference address http://wiki.python.org/jython/WhyJythonWhy Jython?
Currently, many
I have seen beforeA report says a Japanese painted in Excel. He fills each cell in color and reduces the display ratio to display a painting. The reporter interviewed him, he said that because he could not afford a genuine Photoshop, he wanted to
From link http://www.tt010.net/cms/show_article/1057.htmlPost commentsPost by: bossadmin @ [17:11:20] views: 115ADODB: database connection component recommended by our leadersBsddb3: berkeleydb connection componentCheetah-1.0: I prefer this version
The founder of python is Guido vanRossum. In Amsterdam during the Christmas Day of 1989, Guido was determined to develop a new script interpreter as ABC in order to make Christmas boring.An inheritance of a language. Python is selected as the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service