python基礎----變數
- 2020 年 9 月 6 日
- 筆記
- python的學習之路
變數
變數是一個容器,用於存儲數據到記憶體,方便後面需要用到時直接調用變數的名稱即可
變數規則
- 變數名只能是 字母、數字或下劃線的任意組合
- 變數名的第一個字元不能是數字
- 以下關鍵字不能聲明為變數名
- ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']
變數賦值
age = 18
name = "irene"

