Pythonで始めるデータサイエンス入門
Hillary Green-Lerman
Lead Data Scientist, Looker

name = "Bayes"
height = 24
weight = 75.5
my_var と MY_VAR は別)# 有効な変数名
bayes_weight
b
bayes42
# 無効な変数名
bayes-height
bayes!
42bayes
bayes-height = 3
File "<stdin>", line 1
bayes-height = 3
^
SyntaxError: can't assign to operator
float: 整数または小数を表す
height = 24
weight = 75.5
string: 文字列(文字・数字・空白・記号を含められる)を表す
name = 'Bayes'
breed = "Golden Retriever"
owner = DataCamp
File "<stdin>", line 1, in <module>
owner = DataCamp
NameError: name 'DataCamp' is not defined
fur_color = "blonde'
File "<stdin>", line 1
fur_color = "blonde'
^
SyntaxError: EOL while scanning string literal
name = "Bayes"
height = 24
weight = 75
print(height)
24
Pythonで始めるデータサイエンス入門