Python Beginner's Learning

Source: Internet
Author: User

A. Python installation

1. Download the installation package (I use python3.5.1)

  https://www.python.org/downloads/

2. Installing Python-3.5.1.exe

I download is python-3.5.1-embed-amd64.zip green version, unzip directly can open Python-3.5.1.exe

  

Second, declaring variables

    • Variable names can only be any combination of letters, numbers, or underscores
    • The first character of a variable name cannot be a number
    • The following keywords cannot be declared as variable names
      [' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' F ' Rom ', ' Global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' try ', ' while ', ' WI Th ', ' yield ']

Third, user name, password input

  

Iv. if else Judgment statement

#!/usr/bin/env python
#-*-Coding:utf-8-*-
#定义变量并赋值
Age=25
#输入一个数字
Guss_age=int (Input ("Please input Guss Age:"))
#如果比初始定义变量大, the output is too large
If Guss_age>age:
Print ("Too big")
#如果比初始定义变量小, the output is too small
Elif Guss_age<age:
Print ("Too small")
#如果和初始定义变量一样, the output is correct
Else
Print ("Currurt")

Python Beginner's Learning

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.