1
1

More than 3 years have passed since last update.

[Python学習その1]リスト内包表記の書き方と使い方について

Last updated at Posted at 2020-07-25

参考記事:リスト内包表記を使ったリストの作成

リスト内包表記の使い方

基本形

[式 for 変数 in イテラブルオブジェクト]

リストを効率的に書くための方法らしい。

実際に使ってみる

[tweet.user.name for tweet in tweepy.Cursor(api.search, q='スマブラ').items(10) if list(tweet.text)[:2] != ['R', 'T']]

いったん終わる

1
1
2

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
1