First, look at a simple conditional judgment statement.#-*-Coding:utf-8-*-__author__ = "MuT6 sch01ar" a = 3b = 6if a > b: c = aelse: c = 1print (c)A has a value of 3,b of 6, and if the value of a is greater than the value of B, the value of C
#use of while#To be aware of the loops, consider the end of the loop.#There are 2 ways to consider the end of the loop:#1. Consider changing the condition of while in the loop body#2. Jump out of loop through break statement in the loop
With the tornado is really comfortable, a lot of things for you to do.But there are also unsatisfactory places--for me, a neat freak, the automatic printing of my console without my control is intolerable.Connect to a new place and if it fails,
R read-only, r+ read and write, none of two created########################################W New write-only, w+ new read-write, both will clear the contents of the file(opens in W mode and cannot be read out.) w+ Readable and writable)###############
Describes how to work with lists, including create, access, update, delete, other actions, and moreCreate a list: just enclose the comma-delimited data items in square brackets.Accessing the values in the tableValue exceeds index error, slice
Class and object relationships: Class: is a model Object: An entity created by a model that can be seen and touched.The difference between classes and objects It's just a concept, it's a class. The description is very specific , that is
Execute Yum list, prompt/usr/bin/yum errorI am directly on the basis of the Python2.7 and install the Python3.6, and then Ln-s/usr/local/bin/python3/usr/bin/python, and then directly execute Python will default to use the Python3.6 versionBut
Python has a built-in function called REPR, which can express an object in the form of a string for identification, which is the "string representation". Repr is to get a string representation of an object by __repr__ this particular method. If
I. Encoding and decoding of URLs The Urllib and urllib2 included in Python2 are the modules that accept URL requests. But in the Python3, there is no urllib2. In fact, the function of URLLIB2 can be implemented with Urllib in Python3.Usually coding
System Performance Information Module Psutil
Psutil is a cross-platform library that makes it easy to get the process and system utilization (CPU, memory, disk, network, etc.) information of the system running, mainly used for system
Install the PIP tool.1, first check whether Linux installed PYTHON-PIP package, directly execute yum install PYTHON-PIP2, no PYTHON-PIP package on the execution of the command yum-y install Epel-release(3) After successful execution, execute yum
System Performance Information Module PsutilPsutil is a cross-platform library that makes it easy to get the process and system utilization (CPU, memory, disk, network, etc.) information of the system running, mainly used for system monitoring,
Python annotations are divided into three types:1. Single-line Comment: #2. Multiline Comment: 3 single quotes before and after, or three double quotes;such as: ' Multiline comment ', ' "' or multiline comment '" "3. Special NOTES:As under Linux, at
ListFirst define a listDeclaration ListList name =[value 1, value 2]list=[1,2,3,4,5]This is a list with five elements in the list (1,2,3,4,5)Show List ListingPrint ListOutput--[1,2,3,4,5]The subscript for the list starts at 0.Subscript = Length of
The first official explanation S.index (sub[, start[, end]), int raise is not found. S.find (sub[, start[, end]), int in are found, is contained within S[start:end]. Optional and in slice notation. -1 on
Python built-in module ConfigParser implements the configuration of read/write functions, pythonconfigparser
This article describes how to configure the read/write function using the Python built-in module ConfigParser. We will share this with you
Python Flask basic tutorial sample code, pythonflask
This article focuses on the basic tutorial of Python Flask, which is described as follows.
Installation:pip install flaskYou can.
A simple Flask
From flask import Flask # import Flaskapp = Flask (_
Python implements Binary Search Tree instance code and python Binary Tree instance
This article focuses on the implementation of Binary Search Tree in python. The specific introduction and implementation are as follows.
1. Binary Search Tree
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