One, configuration fileThe service side and the client's character encoding is different, may cause garbled display and so on, in order to unify the character encoding at both ends, can be implemented through the configuration file, of course, such
Four lessons a week (October 19)1. Python Arithmetic operatorsAssuming that the value of the variable a is 10 , the b value of the variable is 21 , then-
operator
Description
Example
+
An addition
Overall outlineOne1,int. Number: operation. 1, 2,3 ...2,bool. true: false.3,str. Simple and small amount of storage data, and the corresponding operation name = ' Alex ',4,tupe. (1, ' Alex ')5,list: Large amount of data, [1, ' ses ', true,[1,2,3],{'
Set is a set of unordered and non-repeating elements, equivalent to a dictionary key, non-repeating, immutableFirst, set Variable initializationA = set () #注意在创建空集合的时候只能使用s =set () because s={} created an empty dictionary B = {"One", "one", "three",
Slice : intercepts a string of characters and does not change the original string. Structure: [Start position: End position: Step] But does not include the terminating position. The so-called: Gu Tou disregard the tailindex : Each element in the
Python Basics:One1. Installation and installation of environmentInstalling a Linux system on a Windows system① Installing virtual machines VMware workstation--> Baidu See Tutorial (Virtual machine install Linux (ENTOS7 SSH is installed by
Summary: Python is a computer programming language that has its own set of grammars, and the compiler or interpreter is responsible for translating the grammar-compliant program code into a machine code that the CPU can recognize and execute. Python
1. Data typeThere are four types of Python: integers, long integers, floating-point numbers, and complex numbers.
integers, such as 1
Long integers are relatively large integers.
Floating-point numbers such as 1.23, 3E-2
List is a combination that allows content to be duplicatedA tuple is a combination that allows content to be duplicatedDictSet is a combination that does not allow duplication of content, and the contents of the set are arbitrary, so they cannot be
Python FIX: Nameerror:name ' reload ' is not defined problemFIX: Nameerror:name ' reload ' is not defined problemFor Python 2.X:Import sysreload (SYS) sys.setdefaultencoding ("Utf-8")For Import impimp.reload (SYS)Attention:1. Python 3 differs
Note content: Basic data TypesNote Date: 2017-10-20
Basic data types
In Python, variables do not need to declare data types, but each variable must be assigned before it is used, and only after the assignment is created. So in Python a
1, login program Practice1Readme = open ('Readme.txt,'W')2 3Readme.write (" "the code for the login system of the small demo, there are many imperfect places. 4 The main functions are as follows:5 Login successful, print welcome message, failure
Write a little every day, one day I can become more salty saltedI. File reading and writingExamples are as follows:1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 " "4 Read the file5 " "6 defread_file (filename):7 #Open the file as read-only, the
variable Assignment: variable assignment does not require a declaration type, each variable must be assigned before it is used, and the variable will not be created until the variable is assigned. Multiple variable assignment: a=b=c=1 a,b,c value is
First, function recursionTwo or two-point methodThird, anonymous function lambdaIv. built-in functionsFive, the use of the moduleSix, the packageFirst, function recursionWhat is function recursion?When invoking a function, a direct or indirect call
Python beginners Summary 3: files, collections, functions, variables, etc,
I. File Operations:
File Operation Process:
1. open the file, get the file handle, and assign it to a variable.
2. Operate the file through a handle
3. close the file
File
I learned python for about a week. I wrote a game that guessed numbers !, Python guess number
Print ("-------------------------------------------------------")Print ("-------------------------------------------------------")Print ("--------------
Basic usage of python built-in function isinstance, pythonisinstance Syntax: isinstance (object, type)Purpose: To determine whether an object is of a known type.The first parameter (object) is the object, and the second parameter (type) is the type
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