Computer Basics
Composition 1.1 computer
Input and output devices, a memory, motherboard, CPU, hard disk, memory, display, power, video card.
CPU: Central Processing Unit Central Processing Unit handle a variety of data equivalent to the human brain
Memory: data stored in the temporary power failure data loss
Hard disk: power stored data is not lost
1.2 What is the operating system
Workflow control computer
1.3 What is the application procedure
Software installed on top of the operating system
Summary: CPU ~ human brain, human memory - temporary memory, hard disk - people permanent memory, the operating system - control computer hardware work processes, applications software - installed on the system.
Introduction to Python
Born in 1989, author turtle t
Areas: cloud computing, web development, artificial intelligence, system operation and maintenance, reptiles, finance.
1.1 python 2 and python 3 distinction
python 2 source is not uniform (c, java both) duplicate code
python 3 no unified source code duplication
What programming language 1.2python
Interpreted language,
Compiled: development efficiency slow, fast.
Interpreted: the development of an efficiency block, running slow.
1.3 python species
Cpython、Jpython、IronPython、PyPy
1.4 Installation and Environment Variables
Getting Started
print () output
variable
print(12+34)
print ((12+34)*2)
1.5 variable rules:
1. The variables are letters, numbers, underscores
2. Do not start with a number
3. prohibit the use of keywords in print python, or, is, etc.
4. You can not use Chinese and Pinyin
The variable names are case
6. recommended wording
CamelCase: large peak, a small peak
Decline line named: official recommended.
7 to be descriptive variable names
Note
Single-line comments (comment when the line) can not wrap
Multi-line comments "" "" "" or '' '' ''
"""
I ask you to eat
Steamed lamb
Steamed paws
Steamed Luk Mei child
Burning flower duck
Roast chicken
Roast goose child
"""
Data Types acquaintance
Plastic, numeric, string, man, lists, Boolean value, right or wrong
"String"
'String'
"""字符串"""
"I'am boy" (double quote may be single quotes)
a='alex'
b='wusir'
print (a + b) = alexwusir (string concatenation) Note: only and the same type (character string) may be multiplied by adding (only digital multiplication), but can not be subtracted
a = 'strong'
print (a * 8) multiplied string Note: only the digital multiplication and
Boolean value (that is, right and wrong)
true false
1 0
User interaction (input)
input Output
input ( "precautionary statements")
type type
str string
int plastic
bool Boolean value
Flow control statements
if if
Single if
if key conditions of the colon spaces to indent results.
if nested
if conditions:
Result
if 条件:
Result
if条件:
Result