Python note 4分支 迴圈 條件 列舉

2022-07-13 15:27:14 字數 871 閱讀 3580

什麼是表示式

c語言的定義: 表示式(expression)是運算子(operator)和運算元(operand)所構成的序列

a = 1

b = 2

c = 3

a or b and c

1
c = int('1') + 2

print c

3
1 or 2
1
1 and 3
3
a or b and c#與下面下同

a or (b and c)

c = a + b#右結合,從=的右邊開始
a = 1

b = 2

c = 2

not a or b + 2 == c

false
#上題計算順序為

(not a) or ((b + 2) == c)

not>and>or#優先順序
如何在檔案裡寫**txt,idle是命令列不是檔案

ide(integrated development environment)

pycharm vscode sublime

ctrl+~可以調出vscode 的命令列,再次按 可以關閉

day4 分支和迴圈

可以判斷奇偶性 流程控制 順序執行,分支結構 if 迴圈結構 for,while python中實現分支結構的只有一種if if單分支結構 雙分支結構 多分支結構 for 變數 in 序列 迴圈體讓變數去序列中取值,乙個乙個取,取完為止,每取乙個值執行乙個迴圈 練習3 統計100 200能夠被3整除...

2021 3 8分支迴圈

define crt secure no warnings 1 include 從大到小輸出三個值 int main if a c if b c printf d d d n a,b,c return 0 列印1 100所有3的倍數 int main printf d n i return 0 輾轉...

Git學習筆記4 分支

參考鏈結廖雪峰git教程 建立本地分支 git branch testing 建立乙個分支,並命名為testing 建立遠端分支 分兩步 git branch testing 建立乙個分支,並命名為testing git push origin testing 將分支推送到遠端 相當於建立乙個遠端分...