Syntax errors & notes day01

## grammatical errors & notes

### Syntax

- python syntax, executed from top to bottom, a process will have to stop implementation of the following processes after a condition is met.

- Be sure to pay attention to the level before the name of each language indent.

- if...elif...else

- print('')

`` Python `
Print (" The display output ")
` ``

Python `` `
# three marks, can be wrapped
content = '' 'Moonlight,
suspected ground frost. '' '
Print (Content)
`` `

 

- while

`` Python `
# nested loop
the while True:
Print ( 'This is the first cycle')
the while True:
Print ( 'This is the second cycle, you need to add the following break, in order to abort the current cycle, a cycle for the first . ')
BREAK
BREAK
`` `

```python
#打印1 2 3 4 5 6 8 9 10
count = 1
while count <= 10:
if count != 7:
print(count)
count = count + 1
print('结束')
```

 

```python
'''循环打印'''
count = 0
while count >= 0 and count <= 99:
count = count + 1
print(count)
#或者
count = 1
while count <= 100:
print(count)
count = count + 1
```

- break # abort the current cycle

`` Python `
# 1-10 achieved by printing BREAK
count = 1
the while True: # If the cycle is true
Print (count)
IF count == 10:
BREAK 10 # If the count is equal to abort the current cycle.
. 1 + COUNT = COUNT
Print ( "End")
`

 

 

Error ### notes

1. python must pay attention to grammar before indentation.
2. The judge ended a grammar must be followed by a colon. `:`
3. Analyzing symbols <= not write the equal sign in front of the <number.
4. attention to the case, being given as true, must be True.

Guess you like

Origin www.cnblogs.com/Dtime/p/10954272.html