Python Entry 1-1, python1-1

Source: Internet
Author: User

Python Entry 1-1, python1-1
The first python program, the omnipotent 'Hello world'

Python usage, print hello world:

1 # print ('hello world')hello
Hello variable

What is a variable?

Variables are the amount of changes. The core is the word 'change' and 'quantity'. changes are both changing, and the amount is a measure of the state.

How to define variables? Variable name (equivalent to the house number, pointing to the space), equal sign, variable value

   name='Egon'   sex='male'   age=18   level=10

Definition specification of variables:

1. Variable names can only be any combination of letters, numbers, and underscores

2. the first character of the variable name cannot be a number.

3. Keywords cannot be declared as variable names

 

User-program interaction
File Header
#!/usr/bin/env python# -*- coding: utf-8 -*- 

 

Note

Code comments are divided into single-line and multi-line comments.#. You can use three pairs of double quotation marks for multi-line comments.""" """

  

Input

Input: All input values are saved as strings.

 

 

 

Basic Data Type

Number

Int INTEGER: used for identification: age, ID card number, QQ number, and other integer types

Float floating point: used for identification: decimal type, such as salary, height, and weight

String str string:

Used for identification: descriptive content, such as name, gender, nationality, and race

List

userdata = ['name','passwd']

Used for identification: stores multiple values. For example, a person has multiple hobbies.

 

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.