# Conditional Judgment
The role of Elif:else if
Note: "Colon"
BMI =w/(h*h)
If bmi<15:
Print (' lighter ')
Elif bmi<25:
Print (' normal ')
else BIM:
Print (' obese ')
# loops
For x in XS a bit like the C # foreach
Range () generates an integer sequence, range (101) generates an integer sequence of 0~100
While loop
Find different
One
n = one while n>10: n-1 print(n)
Two
n = ten while n >: = n-1 print('1', N)
The difference between one and two,,,
#dict和set
Dict Dictionary dictionary shorthand,
Key-value Storage,
Fast, indexed,
Advantages compared to list
- The speed of finding and inserting is very fast and will not increase with the increase of key;
- It takes a lot of memory, and it wastes a lot of memory.
Disadvantages:
- The time to find and insert increases as the element increases;
- Small footprint and little wasted memory.
Set and dict are immutable pairs of objects
Immutable objects--just change the value, the object itself does not change.
Where do you use it???
"Python" conditional judgment and looping with Dict and set