You are not logged in. Please login at to post your questions!


Whats map in python 3.5?

What is map in python 3.5?

asked 12 Jun '18, 01:25

mdrzwan12's gravatar image

accept rate: 0%

dict is like map . It is a hashtable rather than a b-tree


answered 12 Jun '18, 01:33

ssp547's gravatar image

accept rate: 25%

$\texttt{map(f,A)}$ is a function that applies a function $\texttt{f}$ to a list $\texttt{A}$. For example you might see people do input reading by $\texttt{map(int,input().split())}$. Note that this is the alternative to using $\texttt{[int(x) for x in input().split()]}$.

There is actually a small difference between the two expressions. $\texttt{[int(x) for x in input().split()]}$ returns a list while $\texttt{map(int,input().split())}$ returns a generator, to make them equivalent do $\texttt{list(map(int,input().split()))}$.

Some examples of using map together with some other related functions.


answered 12 Jun '18, 03:53

gorre_morre's gravatar image

accept rate: 42%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 12 Jun '18, 01:25

question was seen: 127 times

last updated: 12 Jun '18, 03:53