First, Python development: First knowledge Pythona

Source: Internet
Author: User
Tags assert php class

1. Development language:

Advanced languages: Python, Java, PHP, C #, Go, Ruby, C + + ==> bytecode

Low-level language: C, assembly ==> Machine code

2. Comparison of development languages:

PHP class: For writing Web pages, limitations

PYthon Java: Can write Web pages can also write background functions

PYthon performs less efficiently and with high development efficiency
Java execution efficiency and low development efficiency

3.PYthon Type:
Jpthon
Ironpython
Javascriptpython
Rubypython
Cpython
******
PyPy Python developed with CPython

4.PYthon Installation:
Python is installed on the OS,
To perform the operation:
Write a file in accordance with the rules of Python, write the file to Python software, read the contents of the file, then convert and execute, and finally get the results

Python software ==> python Interpreter (memory management)

Python Download: https://www.python.org/downloads/
Python3 is continuing to update
Python2 continues to update slowly to Python3 conversion

5. Perform an action
Reminder user input: User and password
Get user name and password, detect: Username =root password =root
Correct: Get success
Error: Login failed

The use of a.input, always waiting, knowing that the user entered a value, will assign the value of the input to a thing

6. Variable Name
-Alphabet
-Digital
-Underline

PS: Numbers do not start
Cannot make the keyword ' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exce ', ' finally ', ' for ' , ' from ', ' global ', ' if ', ' import ', ' and ',

It is best not to repeat with Python built-in things, with Pycharm programming will prompt an error ...

Portrayal:
a12_b1= "Martial Arts Cheats"
Print (A12_B1)
Print (A12_B1)
Print (A12_B1)
===================
Print ("Martial Arts Cheats")
Print ("Martial Arts Cheats")
Print ("Martial Arts Cheats")
Add: Try to be representative
For example: user_id= "131321546131313132131" between words and words underlined


A.python Foundation
-Basic
1. The first sentence of Python
-Suffix name can be arbitrary?
-When the module is imported, if it is not. PY file
= = = "After the file suffix name is. py
2. Two modes of execution
Python interpreter py file path
Python enters the interpreter:
Real-time input and get to execution results

Inside the file:
In Windows systems:
D:\python35\python 2.py

3.Linux System: Unique Interpretation path
#! /usr/bin/env python
4.# _*_ Coding:utf8 _*_ tell calculator to perform UTF8 encoding
Print (' Hello World ')

Ascill 000000 8-bit
Unicode 000000000000000+ at least 16 bits
How many utf-8 can be expressed by how many means
¥00000001
Medium 00000000000000011
Python3 no concern
Python2 each file only needs to appear in Chinese, the head must add # _*_ Coding:utf8 _*_


#永远等待, until a value is entered by the user, the input value is assigned to the N,n to refer to what the user has entered.

#变量, can only be combined by numbers, letters, underscores, cannot start with a number, Python's keywords are not,
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 ', ' with ', ' yield ']

  

It's best not to repeat the python built-in stuff.

N1=input (' Please enter user name: ')
N2=input (' Please enter password: ')

Print (N1)
Print (N2)
""""
#变量
n1= "Alexa"
n2= "Root"
Print (N1)
Print (N2)

First, Python development: First knowledge Pythona

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.