Python basic syntax review, python syntax Review
Because I took the AI Pattern Recognition Course and asked to use phthon to implement algorithms, I did not take any classes on Wednesday evening. I 'd like to review the main Synta
Python detailed process of crawling Coursera course resources, coursera Course Resources
Sometimes we need to add some classic things to our favorites and review them from time to time. Some courses on Coursera are undoubtedly classic. Most of Coursera's finishing courses provide complete teaching resources, including
Review 6 sessions (December 3)2.5/2.6 module Use2.7 Object-oriented introductionProperties of Class 2.8Method of Class 2.9Built-in Methods for class 3.0Inheritance of the 3.1/3.2 classNotes:Module:Modules are the basic way to organize your code in Python.A python script can run on its own, or it can be imported into another script, which we call a module when the script is imported to run.All. py files can
Review Python string knowledge points and python string knowledge points
String
It is very easy to create a String object in Python. You only need to put the required text in a pair of quotation marks to create a new string (see Listing 1 ). If you think about it, you may be confused. After all, there are two types of
want. I will share this with you in the course of learning.3.Python Regular ExpressionsA python regular expression is a powerful weapon for matching strings. Its design idea is to use a descriptive language to define a rule for a string, and any string that conforms to the rule, we think it "matches", otherwise the string is illegal. This will be shared at the b
, to get the results we want. I will share this with you in the course of learning.3.Python Regular ExpressionsA python regular expression is a powerful weapon for matching strings. Its design idea is to use a descriptive language to define a rule for a string, and any string that conforms to the rule, we think it "matches", otherwise the string is illegal. This
Review the if statement in Python and learn pythonif
Basic statement Structure
Copy codeThe Code is as follows:If condition 1:Execute Statement 1 ......Elif judgment condition 2:Execute Statement 2 ......Elif judgment Condition 3:Execute Statement 3 ......Else:Execute Statement 4 ......
The following execution statement is executed only when the value of "judgment condition" is True.
In
Remember, in the previous section, we introduced the if statement specifically: the process of starting the if statement. When learning the if statement, I do not know much about the basic knowledge of python Programming. maybe I have not done anything that is too complicated. This article will review it and improve the basic statement structure through review.
-like Object object directly. We open another Python command line to deserialize the object we just saved:>>> f = open(‘dump.txt‘, ‘rb‘)>>> d = pickle.load(f)>>> f.close()>>> d{‘age‘: 20, ‘score‘: 88, ‘name‘: ‘Bob‘}The contents of the variable are back!Of course, this variable and the original variable are completely irrelevant objects, they are just the same content.The problem with Pickle is the same as f
someone in the time of not convinced that "is a mule is a horse, pull out to sneak", Zhao Benshan has a famous saying "Take two steps." Its essence is to say that "light is not practice is false." I got a message from a friend today and asked me to remember Python when I was learning python. Actually, I've talked about it over and over again in the previous course
Python Practical case
basic knowledge of Python
All the contents of this article are notes made during the study period, only for personal inspection and review convenience and record. All content is excerpted from: http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000 data type integer floating-point number
String if the string conta
, comment)print(r2.text)Look at the effect:Self-initiatedOf course, the above finally the number of the pass can also be manually review and grab the package software to crawl, just by looking at commetn.js the file also give my own proactive comments provide the direction, there is a load_comment_form() way. is used to load comment-form, it gives the definition of action:action="/‘ + username + ‘/comment/s
environment: Win7 pycharmce_2017.2 python3.6.2
Take one last review. 3.list and tuple
The list is also a data type. You can delete, add elements at any timeAnd the elements in the list are not restricted by type, as opposed to arrays in C, or int or char. and the list can
>>> a=[1,2,3, ' Hi ', [4, ' hi~ ']]
>>> a
[1, 2, 3, ' Hi ', [4, ' hi~ ']]
>>> a[0]
1
>>> a[4][1]
' hi~ '
>>> a[-1]
[4, ' hi~ ']
>>>
That is, the list of what data types can be, but
than using a varchar type. In fact, because the char type usually takes up more space than the varchar type, it is more advantageous to use the varchar type from the point of view of reducing space consumption and reducing disk I/O;3, store very short information, such as house number 101,201 ... Such a short message should be char, because varchar also has a byte to store the information length, the intention of saving storage is now worth the candle.4, fixed-length. For example, using the UUI
DAY1Learning content:Today is the first day of the course, the first day, understand the history of Python, development prospects, but also drank a large bowl of Alex Teacher's soup. Chicken soup is fresh, then learn or learn.Today wrote the first Python program, Hello World. Suddenly think of college when learning C language, writing is this. At this moment, add
the form of return ' a ', [A, ' B '], ' C ' feeling like returning multiple values, in fact a tuple.94. The interactive mode is also a tuple>>>1,2,3>>> (1, 2, 3)95. The function does not have a clear indication of the return value. The return is None96. Return value 0->none 1->object >1->tuple97.def foo (a,*b,**c)The Declaration and definition of the 98.python function together99. Functions can also have attributes such as: __doc__100.
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.