0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python map関数の使い方

Posted at

#いつ使えるのか

  • 基本的に複数要素を持ったもの(リストなど)に対して同じ処理をしたいときに用いる。

#使用法
map(関数 or lambda式,引数(listなど))

  • このようにすると、引数のそれぞれの要素に関数やlambda式が適用される。

#具体例
入力が

1
2 3

だったなら、

WelcomeToAtcoder
a=imput()
b,c=map(int,imput().split())
print(a,b,c)

とすれば

1 2 3 

が出てくる。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?