1. The difference between input and raw_inputRaw_input () directly read the console inputInput () must enclose the character with double quotation marks, otherwise it will error2. Python Common list Operationsa). Add (equivalent to join)>>> [1,2,3]+[
1, print "", print ": Output content to the screen, can be variable, string, number2. SyntaxError: Syntax error3. Code: Python script uses ASCII encoding by default, add #-*-coding:utf-8-*/# Coding=utf-8 at the beginning of code, use Unicode UTF-8
I. Design table structurebefore operating the design database, we should design the database table structure, we will analyze and analyze the classical students, courses, achievements, teachers, the relationship between them, we first analyze the
From: http://blog.csdn.net/yasi_xi/article/details/38384047 list, tuples, dictionaries belong to three built-in data structures in Python 1. List is a set of ordered data structures, That is, you can store a sequence of items in a list. Items in the
Working a little time trying to use the time to learn Python.Office Computer One:
Win7 64-bit Office system
Dial-up connection to intranet via professional software
Idle time off the intranet, with another NIC Sisu network
Scheme:
Parameters# coding=utf-8# 函数的参数def power(x): return x * x;print power(5)After modificationdef power_1(x,n=2): #默认参数可以简化函数的调用 s=1 while n > 0: n = n-1 s = s * x return sprint power_1(2,3)Default parametersdef enroll(name,
Http://www.jb51.net/article/67699.htmUse the Format function in Python for formatting strings: http://www.jb51.net/article/63672.htmHttp://www.runoob.com/python/att-string-format.htmlThe field width and precision representation of a number are
Here's a look at some of the uses of the timer in Python, including the native Sche package and the implementation of the third-party framework Apscheduler. the summer has been done without death. The flower man becomes the man who looks at the
#!/usr/bin/python#-*-coding:utf-8-*-#爬取世纪佳缘#这个网站是真的烦, the beginning of the time with the Scrapy framework, but because of the new contact frame, hit the page after the JS rendering no way, so the use of general crawler#js渲染过的数据, there may be no data
Beginners Python found writing n++, the compiler directly error, very puzzled, and then think of Python in the variable is not like CDefine the variable type in advance, open the specified space in memory, and then start assigning values. In Python,
1.1 Time Module times () and DateTime ()1. Important functions in the time () module
Function
Describe
Asctime ([tuple])
Convert a time tuple to a string
LocalTime ([secs])
Converts the number
Decorative Devicedefinition : Essentially a function, (decorating other functions) is adding additional functionality to other functions.principle : 1. Cannot modify the source code of the decorated function2. Cannot modify the calling mode of the
1. Please write a regular expression to match the mobile phone numberImport reRe.compile (R ' 1[34578]\d{8} ')2. Briefly describe what attributes and attributes of a cookie are usefulCookies are used for server implementation sessions, user login
The Find method can find substrings in a longer string. It returns the leftmost index of the location where the substring is located. Returns 1 if not found
The Join method is used to add elements to the queue, and the queue element that needs to
For example, give a list of movies:The Holy GrailThe Life of BrianThe Meaning of lifeTo convert to a python-readable list, you need to follow these 4 steps:1. Enclose the data in quotation marks and convert the name of the slice to a string;2.
1. Copying a list must use a copy of the slice operator to see the following results, as compared to the expected differencePrint (' Simple assignment ')Shoplist = [' Apple ', ' mango ', ' carrot ', ' banana ']MyList = ShoplistDel Shoplist[0]Print ('
Operations related to python strings and python strings
Python string-related operations
1. string SEARCHName = "today is a \ t beautiful day"Print (name. capitalize () # uppercase lettersPrint (name. center (40, '-') # center display, fill in '-
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