Zero-based learning pythonDay1
1. First, some python
Python 's strengths and weaknesses
Python advantages are many simple can be summarized as follows.
Simple and clear, do one thing only one way.
Low learning curve compared with many other languages, Python is easier to use.
Open source, has a strong community and ecosystem.
Interpreted language, inherently platform portability.
It supports two mainstream programming paradigm (object-oriented programming and functional programming) have provided support.
Scalability and embeddable can be called C / C ++ code can be in C / C ++ calls in the Python .
High degree of standardized codes, readable, there are codes for obsessive compulsive disorder and crowd.
Python shortcomings mainly in the following points.
Slightly lower efficiency and therefore can be computationally intensive tasks from the C / C ++ compilation.
Code can not be encrypted, but now many companies are not selling software, but selling services, the issue will be watered down.
Too many developing frameworks that can be selected (such as Web frameworks have 100 s), you have a choice where there is an error.
- Installation compilation environment
In this paper, a Windows Environment The following describes only the windows used stuff
Can [Python official website ] (https://www.python.org) downloaded to Python 's Windows Installer ( EXE files), note that if Windows 7 is installed you need to install an environment Service Pack 1 patch ( can be installed by some tools installed system software features automatic patch), the installation process is recommended check " the Add Python 3.6 to PATH " (the 3.6 Python added to the PATH environment variable) and choose a custom install, set " Optional features " interface the best " PIP ", " TCL / tk ", " Python the Test Suite " all other items on the check. It is strongly recommended to use a custom installation path and ensure that the path is not Chinese. Installation will be completed to see the " Setup WAS successful " prompt, but start Python environment may be missing because of some dynamic link library file which led Python interpreter can not run common problem isapi-ms-win-crt \ *. dll missing and update DirectX after causing some dynamic link library file is missing, you can refer to the former [ " api-ms-win-crt \ *. dll missing Cause Analysis and Solutions" ] ( ) method or text to explain the rationale carried out directly in the [ Microsoft's official website ] (https://www.microsoft.com/zh-cn/download/details.aspx?id=48145) download Visual C ++ Redistributable for Visual Studio 2015 repair file the latter can download a DirectX repair tool to repair
Log in Anaconda navigator site installation Anaconda navigator integrated compiler tool
Open Anaconda navigator use jupyter as a compilation tools
Click to create a new directory
Function bar corresponding function Needless to say now understand know everything
Python language very strict requirements for indentation
It is generally . 1 th Tab key, or . 4 spaces
Here are a few very simple small example
If you have some other friends language learning experience will be very easy to learn
Programmers sent greetings to the world
Helloworld!
a, b are added
Use format output
Using % d output
Use ascii code simple encryption mailbox
Celsius Fahrenheit turn
Circumference of a circle and the area
Year to determine whether a leap year