iT邦幫忙

DAY 2
0

Python初學起步走系列 第 2

[Python初學起步走-Day2] - Python變數命名規則

Python 變數命名規則 :

  1. 不是空序列
  2. 開頭第一個字不能是數字,可使用大小寫字母或_
  3. 不可與內建關鍵字同名
  4. Python3 加入Unicode(中文也可!)

Python 關鍵字 :

and, as, assert, break, class, continue, def, del, elif, else, except, finally, for, from, global, if, import, in, is, lambda, nonlocal, not, or, pass, raise, return, try, while, with, yield

Python 變數 example

Syu
syu
_syu
SYU
敘

大小寫視為不同變數


上一篇
[Python初學起步走-Day1] - 安裝Python環境
下一篇
[Python初學起步走-Day3] - 數值資料型態與運算符
系列文
Python初學起步走30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言