Python Training Camp Study: Chapter I python basics

Source: Internet
Author: User
1.python Introduction
Python is an interpreted language that code wants to run and must be executed by the interpreter
Interpreter types are CPython, IPython, PyPy, Jython, IronPython, etc.
2. Variables
declaring variables
name=‘Crab’
Variable definition rules

  • Variable names can only be any combination of letters, numbers, or underscores
  • The first character of a variable name cannot be a number
  • Keyword cannot be declared as a variable name

Variable naming habits

驼峰体AgeOfOldboy=22下划线age_of_oldboy=22

Define the low mode of a variable

变量名为中文、拼音变量名过长变量名词不达意

3. Constants
Constants are constant quantities, such as Pai 2.1415 ....
Python does not have a specific syntax to represent constants, which are used to represent constants with all uppercase names in the variable name.
AGE_OF_OLDBOY=22

4. Read user input

name=input(‘what is your name ?‘)print(‘hello‘ + name)

5. Notes
Code comments with #
6. Data type

In Python, the quoted characters are considered to be strings!
Boolean two values, a true (true), a false (false), mainly used for logical judgment!
7. Operators



Python Training Camp Study: Chapter I python basics

Related Article

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.