Files
2025PY/day05/03-程序的三大结构.py
2025-05-22 16:50:44 +08:00

13 lines
441 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 程序的三大结构
# 1.顺序结构:程序从上往下执行,遇到错误终止
print(1)
print(2)
print(a) # 报错因为a不存在一旦报错整个程序就结束了
print('你好世界')
# 2.选择结构
# 程序在执行过程中,遇到了分支(人生走到岔路口,面临选择)
# 选择分为:单选择(单分支)、双选择(双分支)、多选择(多分支)
# 3.循环结构
# 重复 + 有规律 + 迭代