一、For...in
1. 數字迴圈
for i in range(10):
print(i)
一、介紹
1. def __init__ 代表宣告時會自動執行的函式,主要是用來基本屬性設定。
def __init__(self, color, seat):self是class本身,color與seat為傳送過來的值。
一、介紹
官網:https://docs.python.org/3.11/reference/compound_stmts.html#the-if-statement
二、if
一、介紹
官網:https://docs.python.org/3.11/tutorial/controlflow.html#for-statements
二、一維顯示與總計