TC-001 download and simply use Python

Source: Internet
Author: User

As a software test small white, can not be able to write a scripting language. The language that is usually suitable for beginners is shell, Python. Here are some of my learning process to briefly introduce the next 0 basics of how to learn Python. Words do not say, I use is the small turtle big God's teaching video, speak of very interesting, small turtle like to teach hands on the side of teaching, I think than I reported the training institutions teachers to inculcate the concept of teaching a lot better.

1. Pythoncan be used as a scripting language for interpreting other high-level languages, as well as an object-oriented high-level language;CLanguage andJavaprogramming efficiency is much higher.
2.recommended inPythonDownload website3.6version and install it, seewww.python.org/downloads/.
3. IDLEis aPythonThe program's own auxiliary development tool, which is a text box that can interact with the program, is entered in the input box under the Start menu."IDLE"and enter,can find and openIDLEinterface, a beginner can learn interactively by it.
4.String Type inPythonis defined as a character enclosed in double or single quotation marks, for example,

in the there are only string variables in Python, there is no concept of character variables like C speech, for example,

Notice here that all the friends who have studied C and the database know the end of the line use ";" As the end of a line, but Python is a short language, the end of the line does not use a semicolon as a complete, use the ENTER key directly to the next step.

Here's the format: PythonThe basic format of the program is indentation, which represents different scopes through different indents, which is distinct fromCandJAVAand other high-level languages are the most prominent features, and indentation makes the program more concise and tidy. In addition, we need to master several shortcut keys to improve the efficiency of programming:IDLEwindow,Crtl +nrepresents a newPythonProgram Files,Crtl +sthat saves the currently editedPythonProgram Files,F5represents the execution of a program file;TabKeyIs also very important for beginners. It has three functions:1) by pressing Tab key to implement program code indentation ,IDLEnow support the selection of multiple lines of code, to achieve the effect of multi-line indentation;2when you call a built-in function, if you only remember the first few letters, you can enter it and pressTabkey that displays all the built-in functions that begin with the head letter.

The Little turtle is used here to design a simple little game to help us understand how to write a simple scripting language, I made a little change here, in the course of execution, I made a lot of grammatical errors resulting in error:

Here's the script I wrote:

We can see that in Python you can assign values directly using = = or input. If you need to add character content that needs to be enclosed in "", it appears green without an input error. If and else you need to follow: otherwise you will get an error.

Isn't it simple? Download Python and try to write this little game yourself!

TC-001 download and simply use Python

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.