LoginSignup
1
2

More than 5 years have passed since last update.

Python リスト内で文字数が最小の要素を特定するには?

Posted at

a = ['apple', 'beer', 'compsci']
print(min(a))

apple

タイトル通りリストの中からアルファベットの最小ではなく文字数の最小である'beer'をプリントしたいのですがどうすればいいんでしょうか?

1
2
4

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
1
2