#需求
Develop a shopping cart program
Ask the user to enter a salary and then print the Shopping cart menu
Users can constantly buy goods until the money is not enough
In the menu, users can choose to print their own purchased
Close connectionXshell 5 (Build 0655)Copyright (c) 2002-2015 Netsarang Computer, Inc. All rights reserved.Type ' help ' to learn. Xshell prompt.[c:\~]$ telnet 120.55.*.* 8001Connecting to 120.55.*.*:8001 ...Connection established.To escape to local
1.1 return function1.1.1 function as return value>>> def lazy_sum (*args): # variable parameter... def sum ():... Ax = 0... for i in args: # calling parameters of an external function.... Ax = ax + I.... return ax... return sum-- a function
1.1 Mounting Module1.1.1 installing third-party modulesThe third-party library will be Python official pypi.python.org website registration, to install a third-party library, you must first know the name of the library, you can search on the
What is splinter:is a tool for acceptance testing of WEB applications written in Python.When Splinter executes, it automatically opens the browser you specify, accesses the specified URL, and then any behavior you develop for the simulation will be
Practice content:Use Python to manage INI files: Implement queries, add, delete, save operations.Practice Purpose:1. Master the basic operation of the file2. Recognize the INI file3. Understand Configparser;INI configuration file format:Section:
Pronunciation: PatLanguage: Class CCharacteristics:The 1 statement control does not use {} and (), but instead forces the user space or tab indent. The number of spaces and tabs is not necessarily.2 explanatory language, do not need to declare
Conditional judgment and cyclic condition judgmentAge = 20If age >= 18:print ' Your age was ', ageprint ' adult 'Elif Age >=6:print ' teenager 'Elseprint ' Kid 'Cyclenames = [' Michael ', ' Bob ', ' Tracy ', ' Jim ']For name in Names:Print NameRange
What is a functionWe know that the area of the circle is calculated as:S =πr²When we know the value of radius r, we can calculate the area based on the formula. Suppose we need to calculate the area of 3 circles of different sizes:R1 = 12.34R2 = 9.08
ObjectiveThe Python package gives me a good code organization, similar function modules in the same package, not only the code structure is clear, but also easier to call (can be imported with *)However, we will always encounter the import error
Hi, recently learned that there is a computer language, named Python, below a record of their own learning from scratch. There are many languages known to you, such as C language, Java, C + + \C # and so on, as well as JAVASCRI and fire in the mess
one, function call optimization (space span, avoid access to memory)1. Big Data summation, using sumA = range (100000)%timeit-n sum (a) loops, best of 3:3.15 ms per Loop%%timeit ...: s = 0 ...: For i in a:
...: s + = i ... : loops,
What is DictWe already know that list and tuple can be used to represent sequential collections, for example, the name of the class:[' Adam ', ' Lisa ', ' Bart ']Or the test results list:[95, 85, 59]However, to find the corresponding score according
Chapter 1th Text 12nd. Data Structure 55The 3rd Chapter algorithm 103Chapter 4th date and Time 138The 5th Chapter Mathematics Calculation 1576th. Document System 1977th Data Persistent storage and exchange 2678th. Data compression and archiving
ImportTimemember=["Little Turtle","Small Pudding","Night","Stray","Ishin"]Print(Member,"\ n") member=[2,1,3,5,4]Print(Member,"\ n") Member.sort () empty=[]#Create an empty listPrint(member)#adds an element to the list.Member.append ("Lucky Lu Doll")#
TCP Mode server sideThe server-side socket general process is this:
Create a socket (you can choose the socket type Inet,unix, etc., and the connection mode TCP/UDP)
Use bind to expose a port so that the client can easily connect
Python network programming: socket and select implement pseudo-concurrency, pythonsocket
Last address: Python network programming: socket
Add the following content:1. Difference Between send and sendall: send, sendall ret = send ('safagsgdsegsdgew')
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