×

Whats map in python 3.5?

 0 What is map in python 3.5? asked 12 Jun '18, 01:25 -3●1 accept rate: 0%

 0 dict is like map . It is a hashtable rather than a b-tree answered 12 Jun '18, 01:33 3★ssp547 307●7 accept rate: 25%
 0 $\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 964●2●10 accept rate: 42%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×671

question asked: 12 Jun '18, 01:25

question was seen: 127 times

last updated: 12 Jun '18, 03:53