-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMap.py
More file actions
56 lines (33 loc) · 780 Bytes
/
Copy pathMap.py
File metadata and controls
56 lines (33 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'''
Map
Syntax
map(function,iterable)
'''
#
# lst=[1,2,3,4,5,6,7,8,9,10]
# for i in lst:
# print(i**i)
# lst=[1,2,3,4,5,6,7,8,9]
# a=lambda sq : sq**2
# print(list(map(a,lst)))
# number=[1,2,3,4,5,6,7,8,9,10]
# a=map(lambda x : x**2,number)
# print(list(a))
# def square(*args):
# return (args**2)
# print(square(1,2,3,4,5,6,7,8,9,10))
#
#
# lst=['apple','grapes','orange','tomato']
# for i in lst:
# print((i,len(i)),end=' ')
# lst=['apple','grapes','orange','tomato']
# a=[ (i,len(i)) for i in lst]
# print(a)
#
# lst=['apple','grapes','orange','tomato']
# a=lambda s : (s,len(s))
# print(dict(map(a,lst)))
lst=['apple','grapes','orange','tomato']
a= lambda s : (s,len(s))
print(dict(a))