01. Basic python knowledge,

Source: Internet
Author: User

01. Basic python knowledge,
I. What are the differences between compiled and interpreted languages?

1. Compile the source program into machine code and save the result as a binary file. You can directly use the compiled file at runtime.

2. Only when executing a program is interpreted as a machine language for execution by a computer. Therefore, the running speed is not as fast as that of the compiled program. Python is an interpreted language.

Ii. Install python3.x

1. Download the installation package https://www.python.org/downloads/

2. default installation path: C: \ python35

3. Configure the environment variable [Right-click the computer] --> [properties] --> [advanced system settings] --> [advanced] --> [environment variable] --> 【 in the second content box, find a line with the variable name Path, double-click to add the python installation path to a new line (win10 )]

 

Iii. Example of variable assignment

Name = "Oldboylinux"

Name2 = name

Print ("My name is", name, name2)

 

Name = "FeiYangYang"

Print ("My name is", name, name2)

===== Output result ====

My name is Oldboylinux

My name is FeiYangYang Oldboylinux

Drawing description

 

4. How to annotate content and coding definitions in python

1. Single line comment (one well number) # comment content

2. Multi-line comments (a group of three single quotes) ''' comment '''

3. Define the encoding (python uses ASCII code by default)

#! /Usr/bin/env python

#-*-Coding: UTF-8 -*-

======= LHS at least /08/20 ======

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.