Nhập môn Khoa học Dữ liệu với Python
Hillary Green-Lerman
Lead Data Scientist, Looker

name = "Bayes"
height = 24
weight = 75.5
my_var khác MY_VAR)# Biến hợp lệ
bayes_weight
b
bayes42
# Biến không hợp lệ
bayes-height
bayes!
42bayes
bayes-height = 3
File "<stdin>", line 1
bayes-height = 3
^
SyntaxError: can't assign to operator
float: biểu diễn số nguyên hoặc thập phân
height = 24
weight = 75.5
string: biểu diễn văn bản; có thể chứa chữ, số, khoảng trắng và ký tự đặc biệt
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
Nhập môn Khoa học Dữ liệu với Python