Python built-in functions:http://daixuan.blog.51cto.com/5426657/1846987See Python's function Description:https://docs.python.org/2/library/Python17 A common built-in module summary :http://wsyht90.blog.51cto.com/9014030/1845737A. Introduction to
Closed Package (closure) is an important grammatical structure of functional programming.Definition: If a reference is made to a variable in an external scope (but not at the global scope) in an intrinsic function, then the intrinsic function is
I. Examples of common anomalies and scenarios1.AssertionErrorAssertion failure, assertion is common in debugging (means that you do not use ┑ ( ̄д ̄) ┍)Example: def Foo (s): = Int (s) assert'n is zero! ' return / nfoo (0)View CodeThe
The content of this section:
Object-oriented Advanced Syntax section
Static methods, class methods, property methods
Special methods for classes
Reflection
Exception handling
Socket Development Basics
Python Learning note 12-module usageModule Os,sysWhat is a module?Module Os,sysModules are a basic way for Python to organize your codeA python script can be run on its own, or it can be imported into another script, imported with an import Hello
Summarize1, "function: can be expressed as" multi-line Comment "," multi-line string "," inside the single double quotes do not escape "2, R means: Raw3. R only works on the backslash (note the problem of individual \)What is the use of raw string?
height = input (' How tall is your height: ')height = float (height)if 0.01print ()elif heightprint ("Are you sure you're human?" ")Else:exit (' Please enter the correct value ')weight = input (' Your weight is how many kg: ')weight = float
Python Learning note 11-python built-in functionsFirst, look at the Python function description:https://docs.python.org/2/library/Second, Python built-in functions1, ABS get absolute value:View ABS from the Python website
abs(x)
Return
1, the function input () lets the program pauses the operation, waits for the user to enter some text. Once the user input is obtained, Python stores it in a variable for ease of use.message = input ("Please input your name here:")Print
1.capitalize (Change the first character of a string to uppercase)2.casefold (all characters in the string are converted to lowercase)3.center (width) (centers the string and fills the length of the width with a space)4.count (calculates the number
Content of this week's job:1. Display the default shell of root, fedora or User1 user on the current system;[[email protected] home]# grep-e "^ (root|fedora|user1) \>"/etc/passwd |cut-d:-f1,7 root:/bin/bash User1:/bin/bash Fedora:/bin/bash
Python Development Lightweight Crawler (IMOOC summary 07--page parser BeautifulSoup)BeautifulSoup download and install using PIP install: After command line cmd input, pip install Beautifulsoup4beautifulsoup syntax is divided into three parts.
Python provides two basic socket modules.The first one is the Socket, which provides the standard BSD Sockets API.The second is Socketserver, which provides a server-centric class that simplifies the development of Web servers.The following first is
Python's web framework has a variety of Django, Tornado, Flask and more, and Django has its advantages over other web frameworks: Chatty, the framework itself integrates ORM, model binding, template engine, caching, session and many more.Basic
Python built-in functions, which can be build-in Functions via Python's help document, can be viewed via commands under terminal interaction>>> dir ("__builtins__") [' __add__ ', ' __class__ ', ' __contains__ ', ' __delattr__ ', ' __dir__ ', ' __doc_
Python_Day_03 list, dic, tuple method summary, python_day_03tuple
Several data types, dictionaries, lists, and so on are the most common in programming languages. These data types are also available in Python, but some forms are different.In Python,
Python learning file operations,1. Open a file in python
#================================== Open python file () ==============================## open (fileName, type) type = "r" open a file in read-only mode, this file must exist file_r = open ("E:
Set, copy in depth, copy in Depth
1. set: Aggregates different elements to form a set. It is also a data type in Python.
Unchangeable data type: Number, string, and tuples variable type: List, Dictionary
Purpose: remove duplicates from 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