列印報表
大多數時候應該避免列印,因為它可能會分散注意力(應該首選 Out)。
那是:
a
# Out: 1
永遠比
print(a)
# prints: 1
更喜歡支援 python 2 和 3:
print(x) # yes! (works same in python 2 and 3)
print x # no! (python 2 only)
print(x, y) # no! (works differently in python 2 and 3)
大多數時候應該避免列印,因為它可能會分散注意力(應該首選 Out)。
那是:
a
# Out: 1
永遠比
print(a)
# prints: 1
print(x) # yes! (works same in python 2 and 3)
print x # no! (python 2 only)
print(x, y) # no! (works differently in python 2 and 3)