One, the system library provides a library of intrinsic function number characters:1) Str.islower (): Whether the strings are all lowercase2) Str.isspace (): Whether the string is empty3) Help (str): query string function library4) str.replace (old,
Process ControlWith the C language is not the Python Process Control code block is not denoted by {} curly braces, but forced indentation control, and indentation must be consistent, the official recommendation is to use 4 spaces, not recommended to
The
list function can convert a string to a list
'. Join (Somelist) to convert a list to a string
remove an element from a list you can use the DEL statement to implement
A method is a function that is closely related to
The list can be modified, and tuples cannot
A string is a sequence of characters
Using a shard operation to access a range of elements, the implementation of the Shard operation needs to provide two indexes as a boundary, the first element of
Nicecui
This article declined to reprint, if necessary to obtain the author's consent, thank you.
This article link: http://www.cnblogs.com/NiceCui/p/7858473.html
Email: [Email protected]
Date: 2017-11-18
Python learning
3 ways to output an object in reverse in PythonJust use the list to illustrate it:>>> LST = [1,2,3,4,5,6]#Create a table#Method 1:>>> Lst1 = [i forIinchReversed (LST)]#reversed only works with sequences (lists, tuples, strings)>>>lst1[6, 5, 4, 3, 2,
One, document operation(i) inserting the son element1, added to the inside of the specified element after$ (a). Append (b): B as the last son element of A; $ (a). AppendTo (b): A as an element of the last son of B. Both of these must be jquery
This chapter briefly writes the shards and indexes of a stringShardingSharding is the separation of parts of a defined stringShards and indexes of stringsThe value of the 5th-digit character is ENote Give a string, can output any one character, can
Re.match functionRe.match attempts to match a pattern from the starting position of the string, and if the match is not successful, match () returns none.def match (self, string, pos=0, Endpos=-1):"" "Matches Zero | More characters at the beginning
Summary: usually run some scripts, you need to send the results to the mailbox, you can use Python to handle.Module Required:Import datetimeimport timeimport sysimport mimetypes import smtplibimport email. Mimemultipart Import Email. Mimetext from
Objective to introduce:Using the Python script to analyze Nginx's access_log log, get the number of accesses per IP, build a dictionary of IP and access times, and finally sort the dictionary input.#!/usr/bin/env python#-*-coding:utf8-*-"" "Analysis
One, Python installationThe installation of Python is simple under the window system. Visit Python.org/download, download the latest version, and install the process similar to other Windows software. Remember to set the PATH environment variable
I. Introduction of jqueryjquery is a lightweight, multi-browser-compatible JavaScript library. Making it easier for users to work with HTML Document, Events, animate, and facilitate Ajax interaction can greatly simplify JavaScript programming. Its
1. Matche method and search method for reMatch methodMatch (string[, pos[, Endpos])String: Matches the text used,POS: The index in which the text expression begins the search. and start searching for the subscript for stringEndpos: The index of the
Object-oriented 2,Class inheritance
1 class person (object): 2 def _ init _ (self, name, age): 3 self. name = name 4 self. age = age 5 6 def info (self): 7 print ("the person's name is % s age is % d" % (self. name, self. age) 8 9 class yello_person
Python hasattr () getattr () setattr () function Usage Details, hasattrgetattr
Hasattr (object, name)Determines whether an object contains the name attribute or name method. The BOOL value is returned. If the object has a name attribute, True is
Python3 file operations (16 ),1. File Operations1. Introduction
Computer systems are divided into three parts: computer hardware, operating system, and applications.
Applications written in python or other languages must be stored on the hard disk
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