1, character encoding:
Ascil code 255 One byte per character,
Unicode two bytes per character,
UTF8 variable-length Unicode encoding, English one byte, Chinese three bytes.
2. Format the string:
1)%s string
%d integers
%f floating Point
2) format formatted string
eg
#!/usr/bin/env Pyth
# _*_ Coding:utf-8 _*_
# Author:harvey Wang
Name = input (' Name: ')
Age = Input (' Age: ')
Job = input (' job: ')
Salary = input (' Salary: ')
info = ""
----------------Info----------------
Name:%s;
Age:%s;
Job:%s;
Salary:%s;
'% (name, age, job, salary)
Print (info)
Info2 = "'
----------------Info2----------------
Name: {_name}
Age: {_age}
Job: {_job}
Salary: {_salary}
". Format (_name=name,
_age=age,
_job=job,
_salary=salary)
Print (Info2)
Info3 = "'
-----------------Info3-----------------
Name: {0}
Age: {1}
Job: {2}
Salary: {3}
". Format (name, age, job, salary)
3. Circulation and Break,continue
Break end jumps out of the current entire loop
Continue jump out of the loop and into the next loop
While and for loops can use else
Python basic Finishing (i)