LoginSignup
3
0

More than 5 years have passed since last update.

python2 keysメソッド 「built-in method keys of dict object at 0x109475e88」と表示された時の対処法

Posted at

きっかけ

辞書型のキーを取得するため「keys」メソッドを使おうとした際

list=dict.keys
print list

「built-in method keys of dict object at 0x109475e88」
と出力されてしまい「?」となってしまいました.

原因

「keys」メソッドに()つけてないというくだらない原因でした・・・

list=dict.keys()
print list

['Yamada', ‘Ueda’]
と無事出力されてしまいました.

まとめ

メソッドには()つけましょう!

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0