first edited September 29, 2017 9:15:21
Summary
I. Character encoding
Two. Data type
Three. Process Control
Homework
Summary today
Summary
References: Alex
- Character encoding
- String, List of additions and deletions to search
- For, while Loop
I. Character encoding
- ASCII code
- 1 bits is the smallest representation unit in a computer 8bits = 1Byte = 1 bytes 1 bytes is the smallest storage unit in a computer
- ASCII 8 bits per character
- Unicode
Two. Data type
- Str
int shaping
Long integer type
List
Dict
Set
float Float Type
- Multi-line comments
- Single and double quotes do not have any difference, they only apply to single-line. 3 single or double quotation marks for multiple lines of string or multiline comments
- Boolean type
String
- String Common functions:
Remove white space: strip () You can take off the string and specify a space or symbol
Split: Split () splits a string into a list by a specified symbol or space
Length: Len () measure the length of the string
Index: Index (NUM)
Slices: [num1:num2] cut out from NUM1 to num2
Step:
- Gu Tou regardless of the tail
Three. Process Control
- For...else
- While...else
Homework
Job 2
Shopping Cart Procedure
Python shopping.py
Input your salary:5000
You can buy the following things:
- iphone 5800
- Coffee 30
- Book 50
- Condom 90
1
Can't afford to print, how much is the difference?
2
Put in the shopping cart, deduct the money while printing the balance ... 4970
3
4
Q
You bought the following things
Coffee 30
Book.. 333
How many first 3000 do you have?
Bye.
Knowledge points
1 cycles
2 List
Summary today
Python Full Stack road DAY12