Python is a widely used language, and Python is completely free to use, Python is an object-oriented (OOP) language, the class module supports multiple inheritance, polymorphism and so on. I think the most powerful thing about Python is that it can be used flexibly by programs that call other languages.
Before starting to use Python to choose a suitable IDE, I used as Pycharm,pycharm is a very powerful integrated development environment, support LINUX,WINDOWS,MAC and other operating systems, and support a variety of programming languages, with syntax highlighting, smart tips , automatic completion and other functions, can improve the development efficiency.
Note: All content is based on Python3. X
The basic knowledge section of Python:
The Python interpreter is case-sensitive, for example, true and true are not the same for Python interpreters.
The print () function can print anything you want to output, but when you print the string, you must place the string in "" or "inside, and the single and double quotes cannot be mixed. The print () function defaults to the line break after printing, if you do not want the line break to be added at the end of the end= "" Shape:
Print ("What you want to output", end= "")
The Python interpreter considers the contents of single quotes or double quotation marks as strings, so do not quote when using the print () function to output variable content, and beginners are prone to make this mistake. Sanchong quotation marks, you can keep all the formatting of the string, such as line breaks, tabs, quotation marks, etc.
String formatting, often used is%s,.format () is also possible, but beginners must pay attention. Format () is flexible enough to match parameters by location, by name, and by subscript. Here I use format for the output, for reference only.
Operation Result:
In Python, indentation is very important, beginners must note that indentation to use the TAP key, do not play the space themselves, the colon is equally important, there is a risk of the benefits will be indented, it must be memorized , for the people who have just contact with Python this is the most easy to ignore the place.
If, eiif, and else, only if and elif can have conditional judgment statements that are not allowed to receive conditional judgments. In the real beginning to write the program must first write all the conditions, and then use Pass placeholder, and then start to write the main program, otherwise it is easy to forget some conditions to write the final program function is not too complete. When using the while loop, the processing condition statement must first be written , no person will appear dead loop, of course, unless the program itself needs to be executed permanently, similar to while True: such a dead loop. Note that Python treats numbers other than number 0 as true when writing conditional judgments, where none is false, and other types that are considered false are later re-written, not here today.
This is my first study at the time encountered problems, here simply record a convenient future study, where there is said wrong place welcome everyone to criticize correct, study together.
Basics of Python learning