1 Integer Object PyintobjectAn integer object is a fixed-size Python object that has only one inside ob_ival of the actual integer value saved.typedef struct { pyobject_head long ob_ival;} Pyintobject;2 String Object PystringobjectThe Python
Given an age, guess the given age by entering the age.1 #given an age2Age = 603 #the first way, can only guess once4ages = Int (input ("Please enter an age:"))5 ifages = =Age :6 Print("Congratulations, guess right! ")7 elifAges >Age :8 Print(
The so-called built-in method, which is the method that all strings can use, is in the class that creates the string, and the following is a summary:First, we're going to learn a built-in function for help (object), an object that we can create, or
Python's reflection mechanism allows us to use strings to dynamically drive different events, such as importing modules, calling functions, etc., involving functions that have hasattr,getattr,setattr,delattr
Hasattr: Checks whether a
Object-oriented combination usageAn object in one class as a Data property (an object that references another class in one class)A "have" relationship:For example: Define a Human & 1 weapons class and then Zhang San have a gun, Lee four, a
1. Wedge 2. Process vs Object orientedProcess-oriented: process (pipelined thinking)Advantage: Greatly reduce the complexity of the writing program, just follow the steps to be executed, stacking the code can be.Cons: The process is used to solve a
Python struct MODULE
Use
Functions in a struct module
formatting strings
Alignment
Format character
Code usage examples
Python reference manual struct module links
Time ModuleTmie.strptime: Converting a time string to a time typeFormat: Time.strptime (string[string[, format])Results can be used to return the year using Time.tm_year and the remainder to be identical.# Example>>> t = time.strptime ("2018-2-2", "%
I. Background of writingRecently have to learn python, occasionally write some small procedures, the problems encountered in the record, the big God do not spray ~In order to solve the No module named _sqlite3 problem, we all know that Python has a
Python founder:The founder of Python is Guido van Rossum (Guido van Rossum). During the Christmas of 1989, Guido van Rossum to spend time in Amsterdam, determined to develop a new script interpreter, as an inheritance of the ABC language.The latest
I. Introduction to the Random moduleThe random function in the Python standard library can generate randomly floating-point numbers, integers, strings, and even help you randomly select an element in a list sequence, disrupting a set of data, and so
First, mathematics-related1, Absolute Value: ABS (-1)2, Maximum minimum: max ([+ +]), min ([[+])3. Sequence Length: Len (' abc '), Len ([+]), Len ((+))4, take the mold: Divmod (5,2)5. exponentiation: Pow (2,3)6, floating point: round (1)Second,
Variable1. Variable declarationRules for variable definitions:
Variable names can only be any combination of letters, numbers, or underscores
The first character of a variable name cannot be a number
The following keywords
02-add, delete, modify, and query the list in python, 02-add, delete, and delete pythonAdd:
Append () # Add to the end of the original list
In [1]: names = ["Old Wang", "Old Li", "Old liu", "Old Zhang"] In [2]: names. append ("Old Zhao") In [3]:
Sesame HTTP: Installation of Flask, sesame httpflask
Flask is a lightweight Web service program. It is simple, easy to use, and flexible. It is mainly used for some API services.1. Related Links
GitHub: https://github.com/pallets/flask
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