Python-Ref > Data structures > Sets > Set construction
 
 

<-^^->
Klíčová slova
Moduly
Knihovní funkce

Set construction

Expand/Shrink
21
46
27
3
28
42
2
49
27
44
8
8
30
13
42
3
21
8
39
4
38
22
38
17
32
10
2
39
46
29
3
48
38
1
25
41
42
49
26
20
47
30
41
30
24
30
4
42
39
38
17
30
37
47
20
30
19
8
27
5
1
30
24
1
26
3
15
32
33
10
1
21
15
15
15
18
28
28
24
33
24
2
16
35
14
26
15
0
43
5
24
3
8
6
14
17
33
36
32
44
Zdroj: (sets2-1.py)
  1   f = file( "100numbers.txt", "r")
  2   
  3   numbers = set()
  4   for line in f:
  5     numbers.add( int( line.strip()))
  6   
  7   print len( numbers)
  8   print numbers
stdout:
41
set([0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 46, 47, 48, 49])
Doba běhu: 19.0 ms