print 和 print+format

>>> import numpy as np

>>> a = np.array([[1,2,3],[4,5,6],[7,8,9]])

>>> a
array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])


>>> print("the label is",a)
('the label is', array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]]))


>>> print("the label is {}".format(a))
the label is [[1 2 3]
 [4 5 6]
 [7 8 9]]

 

posted on 2020-06-04 18:11  cdekelon  阅读(54)  评论(0)    收藏  举报

导航