Python Basic Learning Day1

Source: Internet
Author: User

Python is an interpreted language

2018.2.2 Assignment of variables

Naming rules for variables

Official suggested underline

Constant

Variable name uppercase is a constant, you should not overwrite

Practice variables:

2018.2.4

Character encoding and Binary

Unicode Unified Code, Universal code

can print multiple lines,msg= comments,print msg

User input

The first method: (Don't use, forget)

The second method:

the problem that occurs when age is entered is the str type

Workaround:

The third method:

Password

If-else Judgment Statement

Practice

While Loop

For Loop

and the Java is similar, write a three each

Practice guess any game

Continue: Jump out of this loop and continue to the next loop

Break: End the entire loop

for I in range (0,10):
if i<5:
Print ("loop", i)
Else:
Continue
Print ("hehe ...")

For loop inline loop

2018.3.1

Module Initial Knowledge

Standard libraries and third-party libraries

General Standard Library put in Lib , third party put in site_package

Sys Library

Os Library

Problems that arise

Import Login

by default in the current directory to find, when login.py placed under the new_dir ,import will not find

Workaround:

    1. Place in a third-party library Sitepackage(too simple to use)
    2. Add path, speak later

What is PYC?

There's PYC under C:\Users\lenovo\AppData\Local\Programs\Python\Python36\Lib\site-packages\__pycache__. file

data types and data operations, similar to Java

Ternary operations

Binary conversion

binary to System : take four in Unity

2 binary , one point four

Byte Type

Learn the Python video notes from Golden Horn King.

Python Basic Learning day1

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.