1. Function nesting 1.1 function nested callNested invocation of a function: in the process of invoking a function, another function is calleddef Bar (): Print (fromthebar. " )def foo (): print("from" Thefoo. " ) bar () foo ()1.2 Finding
List: []dict:{}Tuple: ()ListIn, Max, in, Append,count,extend,index,insert,pop,remove,reverse
Method
Hara Llist
return value
Append
Modify
No
Count
No
Return
First, when installing with PIP install and PIP3 install, error:Fatal Error in launcher:unable to create process using ' "'To inquire about the data, when python2.7 and python3.5 coexist, use the following command: python2-m pip Install XXX python3
First, the local substitution of the stringPython string substitution can be implemented in 2 ways:1 is the method of using the string itself.2 replacing a string with a regularHere's an example to experiment with:A = ' Hello word 'I replaced word
Penalty Games:From random import choicescore=[0,0]Direction=[' left ', ' center ' and ' right ' def kick (): print ' =====you kick!===== ' print ' Choose one side to Shoot ' print ' left center right ' you=input () print ' You kicked
Blink of an eye has passed for several years, the age is getting bigger, the previous dream is also more and more distant, considered a long time not willing to abandon their dreams, and family to discuss for a while family finally agreed to career
# unittest Unit Test Import unittestfrom Class_demo import Carclass testcar (unittest. TestCase): ' test car class ' def setUp (self): ' initialize Data ' ' self.car_obj = car (' Audi ', ' A6 ') def Test_set_odometer (self):
Python installation package:There are two main packages to install: PIL and pytesser ,tesseract(1), Installation pil::http://www.pythonware.com/products/pil/After the download is an EXE program, directly double-click the installation(2),
First, the automation test code at the beginning is linear, followed by the development of modular code, so involves the functions and methods of reference.1. The most important differences between functions and methods:When defining a function in a
1, Python string output there are many kinds. A= ' name:{0},age:{1},sex:{2} '. Format (name,age,sex) FirstName= "Lijiaxiang"Age=12sex= "Male"A= ' Name:{_name},age:{_age},sex:{_sex} '. Format (_name=name,_age=age,_sex=sex) the second typeString also
Use Python to invoke hbase to install thrift Hbase-thriftThrift service to start HBase: bin/hbase-daemon.sh start Thrift default port is 9090MySQL data synchronization to HBase:1. Put2, IMPORTTSV3. Write the MapReduce job import4, SqoopSimple code:#!
First, Introduction
Used to generate and modify common configuration documents, the name of the current module is changed to Configparser in the Python 3.x version.
Second, the configuration file format
[DEFAULT] Serveraliveinterval = 45Compression =
Shelve
Shelve is a simple data storage scheme, he has only one function is open (), the function receives a parameter is the file name, and then return a shelf object, you can use him to store things, you can simply think of him as a dictionary,
1. Select the address where the project is stored by default
The default address is C:\Users\Lee, which is the address of the CMD console, and after the project is created, the command django-admin startproject project_test default address creates
All framework request responses are based on a principle HTTP request-to-WSGI server-to-WSGI interface (which is actually a function of the custom implementation in the framework through the underlying package)-the response can refer to the Liaoche
Basic Requirements:User Portal2. Press Q to exitRealize:1. Use the list and dic2. If judgment while and for loop3. Use documents to record product information and shopping records" "Shopping Cart User Portal1, the product information exists in 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