顯示具有 Python 標籤的文章。 顯示所有文章
顯示具有 Python 標籤的文章。 顯示所有文章

2022年11月5日 星期六

[Python] 迴圈

一、For...in

1. 數字迴圈

for i in range(10):

 print(i)

2021年7月5日 星期一

[ Python ] 類別用法

一、介紹

1. def __init__ 代表宣告時會自動執行的函式,主要是用來基本屬性設定。

def __init__(self, color, seat):self是class本身,color與seat為傳送過來的值。

2021年7月4日 星期日

[ Python ] 基本語法

此為基本語法,轉換、編碼、類別、算數、取代、連結、分割、時間、補0、輸入、str與byte互轉等。

一、轉換

2021年7月3日 星期六

[ Python ] 判斷 - if、elif、else

一、介紹

官網:https://docs.python.org/3.11/reference/compound_stmts.html#the-if-statement

二、if

[ Python ] for....in用法 - 一維與二維

一、介紹

官網:https://docs.python.org/3.11/tutorial/controlflow.html#for-statements

二、一維顯示與總計