1. Conditional judgmentage = 3if age >= 18: print(‘adult‘)elif age >= 6: print(‘teenager‘)else: print(‘kid‘)Elif is an else if abbreviation and can have more than one elif.2. CycleThere are two types of Python loops,One is the for...in loop,
Program 2: Modify the Haproxy configuration fileDemand:11, check2 Input: www.oldboy.org3 get all records under the current backend4 52, New6 Input:7arg = {8 'Bakend':'www.oldboy.org',9 'Record':{Ten 'Server':'1
A dictionary is another mutable container model and can store any type of object.Each key value of the dictionary (key=>value) pairs with a colon (:) split, each pair is separated by a comma (,), and the entire dictionary is enclosed in curly braces
@property is an adorner, supported by the Python native library, without importThe function of @property is to turn a function into a property, generally acting on a member function within a class.First put a code to describe the meaning of the
Directory:
Python language Features
1 function parameter passing of Python
2 meta-classes in Python (metaclass)
3 @staticmethod and @classmethod
4 class variables and instance variables
5 python
For the first time, we take the blog park as an example.Cnblog is a typical static Web page, by looking at the source code of the blog post, you can see very little JS code, even the CSS code is relatively simple, very suitable for beginners to
Requests is a simple and easy-to-use HTTP library implemented by Python, which is much simpler than urllib.Because it is a third-party library, CMD installation is required before usePIP Install requestsOnce the installation is complete, import it,
Python string operations commonly used operations, such as string substitution, deletion, interception, copying, connection, comparison, search, segmentation, etc., the need for friends can refer to.1. Remove spacesStr.strip (): Deletes the
Python2 and Python3 in a little bit different, but for programming is not too big difference, in the release notes, Python2 official support until 2020, so when learning to use Python3 version: 1, the difference between print, In Python2, you can
When using array, the operator * is used to calculate the quantity product (point multiplication), and the function dot () is used to calculate the cross product (cross-multiply).When using matrix, the operator * is used to calculate cross product,
Basic conceptsFunctional programming is a highly abstract programming paradigm, and functions written in purely functional programming languages have no variables. Therefore, any function, as long as the input is determined, the output is determined
steganography (steganography): A technique and science for information hiding, that is, not letting anyone outside of the program know the delivery event of information (not just the content of the information)1, randomly looking for two pictures2,
Try: Raise Nameerror (' wrong ')Except Nameerror as E: Print (e)Common ExceptionsAttributeerror attempts to access a tree that does not have an object, such as foo.x, but Foo has no attribute xIOError input/output exception; Basically, the
Beautiful Soup is a python library that extracts data from HTML or XML files. It is able to use your favorite converter to achieve idiomatic document navigation, find, modify the way the document. a person has at least one dream, there is a reason
Start with python and start with python
1. tranceback is a record
2. print (name. title () uppercase letters
Print (name. upper () Capital
Print (name. lower () lower case
Print ("Hello," + full_name.title () + "! ") Splicing
Print ("language: \ n \
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