運行時出現錯誤AttributeError: 'NoneType' object has no attribute 'format'

運行時出現如下的報錯

import pandas as pd
import numpy as np

print("Missing required dependencies {values}".format(values = ['aaa', 'bbb'])
AttributeError: 'NoneType' object has no attribute 'format'

.format必須放到print語句裏面

print("Missing required dependencies {values}".format(values = ['aaa', 'bbb']))

結果

Missing required dependencies ['aaa', 'bbb']

顯示正常了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章